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
 	assert ( text != NULL );
72
 	assert ( text != NULL );
73
 
73
 
74
 	/* Parse integer */
74
 	/* Parse integer */
75
-	*value = strtoul ( text, &endp, 10 );
75
+	*value = strtoul ( text, &endp, 0 );
76
 	if ( *endp ) {
76
 	if ( *endp ) {
77
 		printf ( "\"%s\": invalid integer value\n", text );
77
 		printf ( "\"%s\": invalid integer value\n", text );
78
 		return -EINVAL;
78
 		return -EINVAL;

Loading…
Cancel
Save