From owner-freebsd-arm@FreeBSD.ORG Wed Apr 29 06:16:25 2009 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1644E106566B for ; Wed, 29 Apr 2009 06:16:25 +0000 (UTC) (envelope-from channa.kad@gmail.com) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.243]) by mx1.freebsd.org (Postfix) with ESMTP id C0D9D8FC0C for ; Wed, 29 Apr 2009 06:16:24 +0000 (UTC) (envelope-from channa.kad@gmail.com) Received: by an-out-0708.google.com with SMTP id c3so614217ana.13 for ; Tue, 28 Apr 2009 23:16:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=1gvTUc4u/ZPrRkzL6L7OxdJBJn+ArAPCClAISrS3PQk=; b=s4TlV2i3P8KS2Wql/8hcJD14zlSR/i430Jfi+EhR9Lf0BkDpKRE3EnZ4mI2gXEWe87 QICLlNCmk+EBbhDN2MIkhkOlXgFbaYv/Dws2C6bfGFGpRXxsGaipL/2szu455NFW0PZ+ yK2XSM/kHoIRNw93cS0uKAx5zNZmoalXEQ7IM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=r2hUE/sHPRKL+qa8VS5XaJHoG7JU9MWrXLUgKK5/iKseWRzJjMYMWS9BdTdpekA9qO krNLWFMYtbR97X1fMhvoliF27Z6XpOvfoldEjHrXzziDBpeoomTWyAm3VfIjKATDMgyL UXc2iMJs54GYd5sNGAAN3ttrJpaxsnTofZD2U= MIME-Version: 1.0 Received: by 10.100.189.8 with SMTP id m8mr11780454anf.90.1240985783954; Tue, 28 Apr 2009 23:16:23 -0700 (PDT) In-Reply-To: <20090428193004.GA5465@ci0.org> References: <515c64960904280252sc9fe2afy24e8db8ab13b13e4@mail.gmail.com> <1240918262.85945.1.camel@buffy.york.ac.uk> <20090428115510.GA98699@ci0.org> <515c64960904280459p3c2ef8bdu3600157eb0c47bcc@mail.gmail.com> <20090428121255.GA99020@ci0.org> <515c64960904280702s5e29f916s5e03564adf96f9b0@mail.gmail.com> <20090428193004.GA5465@ci0.org> Date: Wed, 29 Apr 2009 11:46:23 +0530 Message-ID: <515c64960904282316k5f3e80cdu1c04a8dc3ab25883@mail.gmail.com> From: Channa To: Olivier Houchard Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-arm@freebsd.org Subject: Re: strncmp issue X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Apr 2009 06:16:25 -0000 2009/4/29 Olivier Houchard : > On Tue, Apr 28, 2009 at 07:32:14PM +0530, Channa wrote: >> Hi, >> >> Thank you very much for your response. >> I am looking forward for your fix. >> >> Thanks & Regards, >> Channa >> > > Hi, > > I just committed a fix to -CURRENT, as rev 191633. > It basically just checks if the length is 0, instead of len - 1 < 0. > > Thanks again, > > Olivier > > > Hi Thank you very much. I used your fix and tested again. When i tested as below : TEST 1 : ret = strncmp("a", "L", -1); <----------------- ret is '0' TEST 2: ret = strncmp("1", "2", UINT_MAX); <------ ret is '-1' But since size_t is unsigned int call to strncmp with third argument as -1 should consider third argument as UINT_MAX in TEST 1, but its not happening so. Could you please help me to know what could be the problem. Thanks & Regards, Channa