Procházet zdrojové kódy

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

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown před 14 roky
rodič
revize
01df5c510f
1 změnil soubory, kde provedl 1 přidání a 1 odebrání
  1. 1
    1
      src/core/parseopt.c

+ 1
- 1
src/core/parseopt.c Zobrazit soubor

@@ -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;

Načítá se…
Zrušit
Uložit