From: "Lu, Han" han.lu@intel.com
Signed-off-by: Lu, Han han.lu@intel.com
diff --git a/src/control/ctlparse.c b/src/control/ctlparse.c index 978977d..92e2f95 100644 --- a/src/control/ctlparse.c +++ b/src/control/ctlparse.c @@ -59,7 +59,10 @@ static long get_integer(const char **ptr, long min, long max) goto out;
s = p; - val = strtol(s, &p, 10); + if (*p == '0' && (*(p+1) == 'x' || *(p+1) == 'X')) + val = strtol(s, &p, 16); + else + val = strtol(s, &p, 10); if (*p == '.') { p++; strtol(p, &p, 10); @@ -87,7 +90,10 @@ static long long get_integer64(const char **ptr, long long min, long long max) goto out;
s = p; - val = strtol(s, &p, 10); + if (*p == '0' && (*(p+1) == 'x' || *(p+1) == 'X')) + val = strtol(s, &p, 16); + else + val = strtol(s, &p, 10); if (*p == '.') { p++; strtol(p, &p, 10);