Signed-off-by: Michael Adler <[email protected]>
---
 tools/bg_setenv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/bg_setenv.c b/tools/bg_setenv.c
index bfedcd7..c5def8d 100644
--- a/tools/bg_setenv.c
+++ b/tools/bg_setenv.c
@@ -275,14 +275,14 @@ static error_t parse_opt(int key, char *arg, struct 
argp_state *state)
                        fprintf(stderr, "Invalid number specified for -p.\n");
                        return 1;
                }
-               if (i == 0 || i == 1) {
+               if (i >= 0 && i < ENV_NUM_CONFIG_PARTS) {
                        fprintf(stdout, "Updating config partition #%d\n", i);
                        arguments->which_part = i;
                        part_specified = true;
                } else {
                        fprintf(stderr,
                                "Selected partition out of range. Valid range: "
-                               "0..1.\n");
+                               "0..%d.\n", ENV_NUM_CONFIG_PARTS - 1);
                        return 1;
                }
                break;
-- 
2.33.0

-- 
You received this message because you are subscribed to the Google Groups "EFI 
Boot Guard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/efibootguard-dev/20211014084444.352944-3-michael.adler%40siemens.com.

Reply via email to