Signed-off-by: Michael Brown <mcb30@ipxe.org>
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 );
}
switch ( c ) {
case 's':
opts->subsystem = strtoul ( optarg, &end, 0 );
- if ( *end ) {
+ if ( *end || ( ! *optarg ) ) {
eprintf ( "Invalid subsytem \"%s\"\n",
optarg );
exit ( 2 );