mirror of
https://github.com/ipxe/ipxe
synced 2025-12-23 13:30:57 +03:00
[parseopt] Allow "0x"-prefixed hexadecimal values in integer-valued options
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user