summaryrefslogtreecommitdiffstats
path: root/lib/libc/string/strncmp.c
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1996-08-31 16:52:44 +0000
committerbde <bde@FreeBSD.org>1996-08-31 16:52:44 +0000
commit070eb30ca675029e79f93333b60287527efc0906 (patch)
treed0ca99d3f53a0fe4ea60e83d05baa8825fdd8cc4 /lib/libc/string/strncmp.c
parentdb0af2c4dc8e05c93d178bf31653024d244398bb (diff)
downloadFreeBSD-src-070eb30ca675029e79f93333b60287527efc0906.zip
FreeBSD-src-070eb30ca675029e79f93333b60287527efc0906.tar.gz
Fixed the easy cases of const poisoning in the kernel. Cosmetic.
Diffstat (limited to 'lib/libc/string/strncmp.c')
-rw-r--r--lib/libc/string/strncmp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libc/string/strncmp.c b/lib/libc/string/strncmp.c
index 805b5b0..4b701a9 100644
--- a/lib/libc/string/strncmp.c
+++ b/lib/libc/string/strncmp.c
@@ -48,7 +48,8 @@ strncmp(s1, s2, n)
return (0);
do {
if (*s1 != *s2++)
- return (*(unsigned char *)s1 - *(unsigned char *)--s2);
+ return (*(const unsigned char *)s1 -
+ *(const unsigned char *)(s2 - 1));
if (*s1++ == 0)
break;
} while (--n != 0);
OpenPOWER on IntegriCloud