mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-12 13:30:12 -05:00
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:
parent
b2ed0aa9f2
commit
f47480af37
1 changed files with 2 additions and 2 deletions
|
|
@ -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);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue