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>
This commit is contained in:
Lu, Han 2015-01-14 09:08:30 +08:00 committed by Takashi Iwai
parent b2ed0aa9f2
commit f47480af37

View file

@ -59,7 +59,7 @@ static long get_integer(const char **ptr, long min, long max)
goto out; goto out;
s = p; s = p;
val = strtol(s, &p, 10); val = strtol(s, &p, 0);
if (*p == '.') { if (*p == '.') {
p++; p++;
strtol(p, &p, 10); strtol(p, &p, 10);
@ -87,7 +87,7 @@ static long long get_integer64(const char **ptr, long long min, long long max)
goto out; goto out;
s = p; s = p;
val = strtol(s, &p, 10); val = strtol(s, &p, 0);
if (*p == '.') { if (*p == '.') {
p++; p++;
strtol(p, &p, 10); strtol(p, &p, 10);