From 01df5c510f4949f1d9d85c0067c24b1093e3f838 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Mon, 29 Nov 2010 14:18:43 +0000 Subject: [PATCH] [parseopt] Allow "0x"-prefixed hexadecimal values in integer-valued options Signed-off-by: Michael Brown --- src/core/parseopt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/parseopt.c b/src/core/parseopt.c index ccaed374..f0a3e700 100644 --- a/src/core/parseopt.c +++ b/src/core/parseopt.c @@ -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;