aboutsummaryrefslogtreecommitdiff
path: root/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'utils.c')
-rw-r--r--utils.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/utils.c b/utils.c
index 16a53a3..53bc3fc 100644
--- a/utils.c
+++ b/utils.c
@@ -181,4 +181,14 @@ void *memcheck(void *p)
return p;
}
+
+int memicmp(const void *v1, const void *v2, size_t n)
+{
+ int result = 0;
+ const char *s1 = (const char*)v1, *s2 = (const char*)v2;
+ while (n-- > 0 && (result = tolower(*(s1++)) - tolower(*(s2++))) == 0)
+ ;
+ return result;
+}
+
// vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1