mirror of https://github.com/ipxe/ipxe.git
[util] Treat empty integer strings as invalid
Signed-off-by: Michael Brown <mcb30@ipxe.org>pull/111/merge
parent
770a7bd43a
commit
2000297011
|
@ -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 );
|
||||
}
|
||||
|
|
|
@ -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 );
|
||||
|
|
Loading…
Reference in New Issue