diff --git a/src/util/efirom.c b/src/util/efirom.c index 93cd79fe9..8fa15ca90 100644 --- a/src/util/efirom.c +++ b/src/util/efirom.c @@ -207,14 +207,14 @@ static int parse_options ( const int argc, char **argv, switch ( c ) { case 'v': opts->vendor = strtoul ( optarg, &end, 16 ); - if ( *end ) { + if ( *end || ( ! *optarg ) ) { eprintf ( "Invalid vendor \"%s\"\n", optarg ); exit ( 2 ); } break; case 'd': opts->device = strtoul ( optarg, &end, 16 ); - if ( *end ) { + if ( *end || ( ! *optarg ) ) { eprintf ( "Invalid device \"%s\"\n", optarg ); exit ( 2 ); } diff --git a/src/util/elf2efi.c b/src/util/elf2efi.c index bcd53c9af..4f517d7d2 100644 --- a/src/util/elf2efi.c +++ b/src/util/elf2efi.c @@ -996,7 +996,7 @@ static int parse_options ( const int argc, char **argv, switch ( c ) { case 's': opts->subsystem = strtoul ( optarg, &end, 0 ); - if ( *end ) { + if ( *end || ( ! *optarg ) ) { eprintf ( "Invalid subsytem \"%s\"\n", optarg ); exit ( 2 );