From owner-svn-src-head@FreeBSD.ORG Mon Nov 17 21:01:36 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 04BFED9; Mon, 17 Nov 2014 21:01:36 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E606C665; Mon, 17 Nov 2014 21:01:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAHL1ZDh074281; Mon, 17 Nov 2014 21:01:35 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAHL1ZZ7074280; Mon, 17 Nov 2014 21:01:35 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201411172101.sAHL1ZZ7074280@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 17 Nov 2014 21:01:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274636 - head/sys/libkern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Nov 2014 21:01:36 -0000 Author: delphij Date: Mon Nov 17 21:01:35 2014 New Revision: 274636 URL: https://svnweb.freebsd.org/changeset/base/274636 Log: Sync with userland variant. MFC after: 2 weeks Modified: head/sys/libkern/strncmp.c Modified: head/sys/libkern/strncmp.c ============================================================================== --- head/sys/libkern/strncmp.c Mon Nov 17 20:25:21 2014 (r274635) +++ head/sys/libkern/strncmp.c Mon Nov 17 21:01:35 2014 (r274636) @@ -10,7 +10,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -33,9 +33,7 @@ __FBSDID("$FreeBSD$"); #include int -strncmp(s1, s2, n) - register const char *s1, *s2; - register size_t n; +strncmp(const char *s1, const char *s2, size_t n) { if (n == 0) @@ -44,7 +42,7 @@ strncmp(s1, s2, n) if (*s1 != *s2++) return (*(const unsigned char *)s1 - *(const unsigned char *)(s2 - 1)); - if (*s1++ == 0) + if (*s1++ == '\0') break; } while (--n != 0); return (0);