From owner-freebsd-arm@FreeBSD.ORG Wed Apr 29 22:03:18 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 572FD1065706 for ; Wed, 29 Apr 2009 22:03:18 +0000 (UTC) (envelope-from mlfbsd@dong.ci0.org) Received: from dong.ci0.org (dong.ci0.org [IPv6:2001:7a8:2066:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 700C48FC16 for ; Wed, 29 Apr 2009 22:03:17 +0000 (UTC) (envelope-from mlfbsd@dong.ci0.org) Received: from dong.ci0.org (localhost.ci0.org [127.0.0.1]) by dong.ci0.org (8.14.3/8.14.3) with ESMTP id n3TMCbAr028859; Thu, 30 Apr 2009 00:12:37 +0200 (CEST) (envelope-from mlfbsd@dong.ci0.org) Received: (from mlfbsd@localhost) by dong.ci0.org (8.14.3/8.14.3/Submit) id n3TMCbAU028857; Thu, 30 Apr 2009 00:12:37 +0200 (CEST) (envelope-from mlfbsd) Date: Thu, 30 Apr 2009 00:12:36 +0200 From: Olivier Houchard To: Channa Message-ID: <20090429221236.GA28784@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> <515c64960904282316k5f3e80cdu1c04a8dc3ab25883@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <515c64960904282316k5f3e80cdu1c04a8dc3ab25883@mail.gmail.com> User-Agent: Mutt/1.4.1i 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 22:03:18 -0000 On Wed, Apr 29, 2009 at 11:46:23AM +0530, Channa wrote: > 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' > I'm a bit confused here, when I test this I get 21, which is the intended result. Are you sure you weren't still using the old strncmp() ? Regards, Olivier