aboutsummaryrefslogtreecommitdiffstats
path: root/missing/strncasecmp.c
diff options
context:
space:
mode:
authorMichal Rokos <m.rokos@sh.cvut.cz>2002-01-04 11:12:22 +0000
committerMichal Rokos <m.rokos@sh.cvut.cz>2002-01-04 11:12:22 +0000
commit30c7790a512172b5254775fbad8f601d5638c1e6 (patch)
tree39a0ceb2db8fcd07e8b82bc107e5cc2a05df9d24 /missing/strncasecmp.c
parent99d5a24aa57c9eb4ac792a36e0947dc5df84fe8c (diff)
downloadruby-openssl-history-30c7790a512172b5254775fbad8f601d5638c1e6.tar.gz
* Further checking (Check_SafeStr, memory leaks)
Diffstat (limited to 'missing/strncasecmp.c')
-rw-r--r--missing/strncasecmp.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/missing/strncasecmp.c b/missing/strncasecmp.c
new file mode 100644
index 0000000..e4d1bb9
--- /dev/null
+++ b/missing/strncasecmp.c
@@ -0,0 +1,19 @@
+#include <ctype.h>
+
+int
+strncasecmp(p1, p2, len)
+ char *p1;
+ char *p2;
+ int len;
+{
+ for (; len != 0; len--, p1++, p2++) {
+ if (toupper(*p1) != toupper(*p2)) {
+ return toupper(*p1) - toupper(*p2);
+ }
+ if (*p1 == '\0') {
+ return 0;
+ }
+ }
+ return 0;
+}
+