]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[parseopt] Allow "0x"-prefixed hexadecimal values in integer-valued options
authorMichael Brown <mcb30@ipxe.org>
Mon, 29 Nov 2010 14:18:43 +0000 (14:18 +0000)
committerMichael Brown <mcb30@ipxe.org>
Mon, 29 Nov 2010 14:18:43 +0000 (14:18 +0000)
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/core/parseopt.c

index ccaed374579d3aac4e41a176b6b866f12e7cfa18..f0a3e70087b3c8fea82bccfa3a1b904520c00037 100644 (file)
@@ -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;