From f47480af37eebe4b89020449077d731ad25abc76 Mon Sep 17 00:00:00 2001 From: "Lu, Han" Date: Wed, 14 Jan 2015 09:08:30 +0800 Subject: control: enable octal and hexadecimal parse Use zero-base for strtol(), so get_integer() and get_integer64() can parse decimal, octal and hexadecimal data from input string. Signed-off-by: Lu, Han Signed-off-by: Takashi Iwai --- src/control/ctlparse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/control/ctlparse.c b/src/control/ctlparse.c index 978977db..8d6c3859 100644 --- a/src/control/ctlparse.c +++ b/src/control/ctlparse.c @@ -59,7 +59,7 @@ static long get_integer(const char **ptr, long min, long max) goto out; s = p; - val = strtol(s, &p, 10); + val = strtol(s, &p, 0); if (*p == '.') { p++; strtol(p, &p, 10); @@ -87,7 +87,7 @@ static long long get_integer64(const char **ptr, long long min, long long max) goto out; s = p; - val = strtol(s, &p, 10); + val = strtol(s, &p, 0); if (*p == '.') { p++; strtol(p, &p, 10); -- cgit v1.2.1