From: Takashi Iwai Subject: Re: [PATCH - UCM 1/2] control: enable octal and hexadecimal parse Date: Tue, 13 Jan 2015 21:01:37 +0100 Message-ID: References: <1421118039-8075-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 6424E260483 for ; Tue, 13 Jan 2015 21:01:38 +0100 (CET) In-Reply-To: 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: Takashi Iwai Cc: Liam Girdwood , han.lu@intel.com, alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Tue, 13 Jan 2015 17:53:14 +0100, Takashi Iwai wrote: > > At Tue, 13 Jan 2015 11:00:38 +0800, > han.lu@intel.com wrote: > > > > From: "Lu, Han" > > > > Signed-off-by: Lu, Han > > 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