programmer_table: replace PROGRAMMER_INVALID with programmer_table_size
Change-Id: Icaaeefe001de604df9d7fdd06f05a5ed39fdbd84
Signed-off-by: Thomas Heijligen <thomas.heijligen@secunet.de>
Original-Reviewed-on: https://review.coreboot.org/c/flashrom/+/55117
Original-Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/flashrom-stable/+/71374
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/libflashrom.c b/libflashrom.c
index 743c400..5402978 100644
--- a/libflashrom.c
+++ b/libflashrom.c
@@ -134,11 +134,11 @@
{
unsigned prog;
- for (prog = 0; prog < PROGRAMMER_INVALID; prog++) {
+ for (prog = 0; prog < programmer_table_size; prog++) {
if (strcmp(prog_name, programmer_table[prog]->name) == 0)
break;
}
- if (prog >= PROGRAMMER_INVALID) {
+ if (prog >= programmer_table_size) {
msg_ginfo("Error: Unknown programmer \"%s\". Valid choices are:\n", prog_name);
list_programmers_linebreak(0, 80, 0);
return 1;