summaryrefslogtreecommitdiff
path: root/src/lib/libc/string/strcasecmp.c
diff options
context:
space:
mode:
authorderaadt <>2003-06-11 21:08:16 +0000
committerderaadt <>2003-06-11 21:08:16 +0000
commit05ebc6b11cf74e0e9e901f2e1c26d0d682c57842 (patch)
tree0ab503c1cf313bdf01aa32f8ffd0938a3d19c2a9 /src/lib/libc/string/strcasecmp.c
parent9b3b34e9713b6e433e3bb19fc1808375d5c69917 (diff)
downloadopenbsd-05ebc6b11cf74e0e9e901f2e1c26d0d682c57842.tar.gz
openbsd-05ebc6b11cf74e0e9e901f2e1c26d0d682c57842.tar.bz2
openbsd-05ebc6b11cf74e0e9e901f2e1c26d0d682c57842.zip
ansification; pval ok
Diffstat (limited to 'src/lib/libc/string/strcasecmp.c')
-rw-r--r--src/lib/libc/string/strcasecmp.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/src/lib/libc/string/strcasecmp.c b/src/lib/libc/string/strcasecmp.c
index f2ad06a726..62da063444 100644
--- a/src/lib/libc/string/strcasecmp.c
+++ b/src/lib/libc/string/strcasecmp.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: strcasecmp.c,v 1.4 2003/06/02 20:18:38 millert Exp $ */ 1/* $OpenBSD: strcasecmp.c,v 1.5 2003/06/11 21:08:16 deraadt Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1987, 1993 4 * Copyright (c) 1987, 1993
@@ -35,7 +35,7 @@
35#if 0 35#if 0
36static char sccsid[] = "@(#)strcasecmp.c 8.1 (Berkeley) 6/4/93"; 36static char sccsid[] = "@(#)strcasecmp.c 8.1 (Berkeley) 6/4/93";
37#else 37#else
38static char *rcsid = "$OpenBSD: strcasecmp.c,v 1.4 2003/06/02 20:18:38 millert Exp $"; 38static char *rcsid = "$OpenBSD: strcasecmp.c,v 1.5 2003/06/11 21:08:16 deraadt Exp $";
39#endif 39#endif
40#endif /* LIBC_SCCS and not lint */ 40#endif /* LIBC_SCCS and not lint */
41 41
@@ -82,12 +82,11 @@ static const u_char charmap[] = {
82}; 82};
83 83
84int 84int
85strcasecmp(s1, s2) 85strcasecmp(const char *s1, const char *s2)
86 const char *s1, *s2;
87{ 86{
88 register const u_char *cm = charmap, 87 const u_char *cm = charmap;
89 *us1 = (const u_char *)s1, 88 const u_char *us1 = (const u_char *)s1;
90 *us2 = (const u_char *)s2; 89 const u_char *us2 = (const u_char *)s2;
91 90
92 while (cm[*us1] == cm[*us2++]) 91 while (cm[*us1] == cm[*us2++])
93 if (*us1++ == '\0') 92 if (*us1++ == '\0')
@@ -96,14 +95,12 @@ strcasecmp(s1, s2)
96} 95}
97 96
98int 97int
99strncasecmp(s1, s2, n) 98strncasecmp(const char *s1, const char *s2, size_t n)
100 const char *s1, *s2;
101 register size_t n;
102{ 99{
103 if (n != 0) { 100 if (n != 0) {
104 register const u_char *cm = charmap, 101 const u_char *cm = charmap;
105 *us1 = (const u_char *)s1, 102 const u_char *us1 = (const u_char *)s1;
106 *us2 = (const u_char *)s2; 103 const u_char *us2 = (const u_char *)s2;
107 104
108 do { 105 do {
109 if (cm[*us1] != cm[*us2++]) 106 if (cm[*us1] != cm[*us2++])