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