[util] Treat empty integer strings as invalid

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2020-06-19 16:56:02 +01:00
parent 770a7bd43a
commit 2000297011
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -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 );