[alsa-devel] [PATCH - UCM 1/2] control: enable octal and hexadecimal parse

Takashi Iwai tiwai at suse.de
Tue Jan 13 17:53:14 CET 2015


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?


thanks,

Takashi

> 
> diff --git a/src/control/ctlparse.c b/src/control/ctlparse.c
> index 978977d..acaf734 100644
> --- a/src/control/ctlparse.c
> +++ b/src/control/ctlparse.c
> @@ -59,10 +59,10 @@ 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);
> +		strtol(p, &p, 0);
>  	}
>  	if (*p == '%') {
>  		val = (long)convert_prange1(strtod(s, NULL), min, max);
> @@ -87,10 +87,10 @@ 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);
> +		strtol(p, &p, 0);
>  	}
>  	if (*p == '%') {
>  		val = (long long)convert_prange1(strtod(s, NULL), min, max);
> -- 
> 2.1.0
> 


More information about the Alsa-devel mailing list