Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: han.lu@intel.com
Cc: alsa-devel@alsa-project.org
Subject: Re: [PATCH - UCM 1/2] control: enable octal and hexadecimal parse
Date: Wed, 14 Jan 2015 12:16:34 +0100	[thread overview]
Message-ID: <s5htwzthast.wl-tiwai@suse.de> (raw)
In-Reply-To: <1421197710-13947-1-git-send-email-han.lu@intel.com>

At Wed, 14 Jan 2015 09:08:30 +0800,
han.lu@intel.com wrote:
> 
> From: "Lu, Han" <han.lu@intel.com>
> 
> 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>

Applied, thanks.


Takashi

> 
> diff --git a/src/control/ctlparse.c b/src/control/ctlparse.c
> index 978977d..8d6c385 100644
> --- a/src/control/ctlparse.c
> +++ b/src/control/ctlparse.c
> @@ -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);
> -- 
> 1.9.1
> 

  reply	other threads:[~2015-01-14 11:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-14  1:08 [PATCH - UCM 1/2] control: enable octal and hexadecimal parse han.lu
2015-01-14 11:16 ` Takashi Iwai [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-01-13  3:00 han.lu
2015-01-13 16:53 ` Takashi Iwai
2015-01-13 18:21   ` Liam Girdwood
2015-01-13 20:01   ` Takashi Iwai
2015-01-14  1:28     ` Lu, Han

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5htwzthast.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=han.lu@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox