diff options
author | Lu, Han <han.lu@intel.com> | 2015-01-14 09:08:30 +0800 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2015-01-14 12:15:33 +0100 |
commit | f47480af37eebe4b89020449077d731ad25abc76 (patch) | |
tree | 8956d14b1707603fabb5bb0eac7ef8fd1b57b9da | |
parent | b2ed0aa9f28979f125a9db0548cfd38ac2334775 (diff) | |
download | alsa-lib-f47480af37eebe4b89020449077d731ad25abc76.tar.gz |
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 <han.lu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | src/control/ctlparse.c | 4 |
1 files 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); |