summaryrefslogtreecommitdiffstats
path: root/sys/libkern
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2014-11-17 21:01:35 +0000
committerdelphij <delphij@FreeBSD.org>2014-11-17 21:01:35 +0000
commit8d13dca13bd1aed4398912e6c65f720113edbbe1 (patch)
treeba3cb3f688c8262f780e8342e6eefca3dd5c3027 /sys/libkern
parente2c749f5de4db291bbdcd0538f691ffe2a3fdb49 (diff)
downloadFreeBSD-src-8d13dca13bd1aed4398912e6c65f720113edbbe1.zip
FreeBSD-src-8d13dca13bd1aed4398912e6c65f720113edbbe1.tar.gz
Sync with userland variant.
MFC after: 2 weeks
Diffstat (limited to 'sys/libkern')
-rw-r--r--sys/libkern/strncmp.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/libkern/strncmp.c b/sys/libkern/strncmp.c
index 5758d24..268ffbe 100644
--- a/sys/libkern/strncmp.c
+++ b/sys/libkern/strncmp.c
@@ -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 <sys/libkern.h>
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);
OpenPOWER on IntegriCloud