From: Takashi Iwai Subject: Re: [PATCH - UCM 1/2] control: enable octal and hexadecimal parse Date: Wed, 14 Jan 2015 12:16:34 +0100 Message-ID: References: <1421197710-13947-1-git-send-email-han.lu@intel.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 2EC822617A4 for ; Wed, 14 Jan 2015 12:16:35 +0100 (CET) In-Reply-To: <1421197710-13947-1-git-send-email-han.lu@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: han.lu@intel.com Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Wed, 14 Jan 2015 09:08:30 +0800, han.lu@intel.com wrote: > > From: "Lu, Han" > > 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 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 >