From: Kurt Zeilenga Date: Wed, 4 Nov 1998 18:47:15 +0000 (+0000) Subject: 8-bit memcmp() X-Git-Tag: OPENLDAP_SLAPD_BACK_LDAP~1222 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=cedf6b4b5f4424cdd8b102654f6387937060b612;p=openldap 8-bit memcmp() --- diff --git a/libraries/liblutil/memcmp.c b/libraries/liblutil/memcmp.c new file mode 100644 index 0000000000..b2c575d955 --- /dev/null +++ b/libraries/liblutil/memcmp.c @@ -0,0 +1,19 @@ +#include "portable.h" + +#include + +/* + * Memory Compare + */ +int +memcmp(const void *v1, const void *v2, int n) +{ + if (n != 0) { + register const unsigned char *s1=v1, *s2=v2; + do { + if (*s1++ != *s2++) + return (*--s1 - *--s2); + } while (--n != 0); + } + return (0); +}