From owner-freebsd-current@FreeBSD.ORG Tue Apr 28 10:21:42 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 142221065737 for ; Tue, 28 Apr 2009 10:21:42 +0000 (UTC) (envelope-from channa.kad@gmail.com) Received: from yx-out-2324.google.com (yx-out-2324.google.com [74.125.44.28]) by mx1.freebsd.org (Postfix) with ESMTP id EDFC78FC1E for ; Tue, 28 Apr 2009 10:21:40 +0000 (UTC) (envelope-from channa.kad@gmail.com) Received: by yx-out-2324.google.com with SMTP id 8so295273yxb.13 for ; Tue, 28 Apr 2009 03:21:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=vDnXkHx4Q2IHuRhJF7tVmPPb0Fn3ma7CiIXbrKbXv9k=; b=xZmYtGYTsqmiRfbqsrUxi5X6hnkr/728O+5VBobrDILOoXHlHmTPp42sfQHUJs7DSd uATQnC6jqLhuixOWUtnY0YRpZIXFqfSTAqlZZPHp8jHNasdHVcpQE9zgF8VlVa5VqyaH wjk0f60F6Ahz2BS8H/BJs7rWd8Cm6D2waVUe0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=aYKe73t+6w2qifg9pw64mGDauAPqOf+gcA4nrN8nOrWi5lgNeTak1HDkBfelIYb6Di PJnLXmCR5ARgjzKn9KFhfLuXEh9fMK6GN1ONHBBFgl7ysCOVNqPDX4G3CDnVM3I2tkSp IC/5fng3G+pCqrSoCT9X6MtqjToKy4Hz0uE7E= MIME-Version: 1.0 Received: by 10.100.165.3 with SMTP id n3mr5729045ane.111.1240912361098; Tue, 28 Apr 2009 02:52:41 -0700 (PDT) Date: Tue, 28 Apr 2009 15:22:41 +0530 Message-ID: <515c64960904280252sc9fe2afy24e8db8ab13b13e4@mail.gmail.com> From: Channa To: freebsd-current@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: strncmp issue X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Apr 2009 10:21:42 -0000 Hi, I am using the freebsd implementation of strncmp for ARM which is an assembly implementation. I have a small doubt, when i tested the strncmp by passing the third argument: 'n' as -1 the return values is '0' instead it should '-1'. When the third argument to strncmp is as below: ret = strncmp("a","b",-1) I think the assembly implementation in src/lib/libc/arm/string/strncmp.S file needs to be modified to take care of the above condition. In the current implementation /* if ((len - 1) < 0) return 0 */ subs r2, r2, #1 movmi r0, #0 RETc(mi) This should be changed to check as below /* if ((len ) < 0) return 0 */ /* Assembly code here */ Could anyone help in solving the above issue.? Thanks & Regards, Channagoud