[alsa-devel] [PATCH - UCM 1/2] control: enable octal and hexadecimal parse
Takashi Iwai
tiwai at suse.de
Tue Jan 13 21:01:37 CET 2015
At Tue, 13 Jan 2015 17:53:14 +0100,
Takashi Iwai wrote:
>
> At Tue, 13 Jan 2015 11:00:38 +0800,
> han.lu at intel.com wrote:
> >
> > From: "Lu, Han" <han.lu at intel.com>
> >
> > Signed-off-by: Lu, Han <han.lu at intel.com>
>
> Looks good to me. Liam, any objection for this extension?
Erm, sorry, I correct my statement: this is buggy. Look at the code:
> > - val = strtol(s, &p, 10);
> > + val = strtol(s, &p, 0);
> > if (*p == '.') {
> > p++;
> > - strtol(p, &p, 10);
> > + strtol(p, &p, 0);
The second strtol() is for skipping the decimals. So this has to be
10-based. That is, use zero-base only for the first strtol().
Takashi
More information about the Alsa-devel
mailing list