From: Lu, Han Date: Wed, 14 Jan 2015 01:08:30 +0000 (+0800) Subject: control: enable octal and hexadecimal parse X-Git-Tag: v1.0.29~12 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=f47480af37eebe4b89020449077d731ad25abc76;p=alsa-lib.git 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 --- 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);