Browse Source

[parseopt] Allow "0x"-prefixed hexadecimal values in integer-valued options

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 14 years ago
parent
commit
01df5c510f
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      src/core/parseopt.c

+ 1
- 1
src/core/parseopt.c View File

@@ -72,7 +72,7 @@ int parse_integer ( const char *text, unsigned int *value ) {
72 72
 	assert ( text != NULL );
73 73
 
74 74
 	/* Parse integer */
75
-	*value = strtoul ( text, &endp, 10 );
75
+	*value = strtoul ( text, &endp, 0 );
76 76
 	if ( *endp ) {
77 77
 		printf ( "\"%s\": invalid integer value\n", text );
78 78
 		return -EINVAL;

Loading…
Cancel
Save