diff options
| author | Daniel Gerzo <danger@FreeBSD.org> | 2009-02-03 17:58:20 +0000 |
|---|---|---|
| committer | Daniel Gerzo <danger@FreeBSD.org> | 2009-02-03 17:58:20 +0000 |
| commit | bd604b4b064135e661660c045cd31145e2e4ce71 (patch) | |
| tree | c5d6de4ed720c8bb5b4d132f30cd8fbd28bbeb81 /lib/libc/string/strncmp.c | |
| parent | 23ee18767ede4614aedbe8645e896f0194f3500c (diff) | |
Notes
Diffstat (limited to 'lib/libc/string/strncmp.c')
| -rw-r--r-- | lib/libc/string/strncmp.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/libc/string/strncmp.c b/lib/libc/string/strncmp.c index 659a7cbaff4f..5bc3d5e61a85 100644 --- a/lib/libc/string/strncmp.c +++ b/lib/libc/string/strncmp.c @@ -36,9 +36,7 @@ __FBSDID("$FreeBSD$"); #include <string.h> int -strncmp(s1, s2, n) - const char *s1, *s2; - size_t n; +strncmp(const char *s1, const char *s2, size_t n) { if (n == 0) @@ -47,7 +45,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); |
