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

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