mirror of
https://github.com/xcat2/xNBA.git
synced 2025-04-15 17:49:26 +00:00
[parseopt] Allow "0x"-prefixed hexadecimal values in integer-valued options
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
parent
1fcea25c42
commit
01df5c510f
@ -72,7 +72,7 @@ int parse_integer ( const char *text, unsigned int *value ) {
|
||||
assert ( text != NULL );
|
||||
|
||||
/* Parse integer */
|
||||
*value = strtoul ( text, &endp, 10 );
|
||||
*value = strtoul ( text, &endp, 0 );
|
||||
if ( *endp ) {
|
||||
printf ( "\"%s\": invalid integer value\n", text );
|
||||
return -EINVAL;
|
||||
|
Loading…
x
Reference in New Issue
Block a user