]> git.alsa-project.org Git - alsa-lib.git/commitdiff
control: enable octal and hexadecimal parse
authorLu, Han <han.lu@intel.com>
Wed, 14 Jan 2015 01:08:30 +0000 (09:08 +0800)
committerTakashi Iwai <tiwai@suse.de>
Wed, 14 Jan 2015 11:15:33 +0000 (12:15 +0100)
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>
src/control/ctlparse.c

index 978977dbc3db4f1b6934a87331186d434c6d1bbb..8d6c3859bec49033a6d014a81ef05b7b992b9e4a 100644 (file)
@@ -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);