]> git.sur5r.net Git - openldap/blob - libraries/liblutil/memcmp.c
All implementations of lutil_lockf (aka ldap_lockf) block until
[openldap] / libraries / liblutil / memcmp.c
1 #include "portable.h"
2
3 #include <ac/string.h>
4
5 /* 
6  * Memory Compare
7  */
8 int
9 (memcmp)(const void *v1, const void *v2, int n) 
10 {
11     if (n != 0) {
12                 const unsigned char *s1=v1, *s2=v2;
13         do {
14             if (*s1++ != *s2++)
15                 return (*--s1 - *--s2);
16         } while (--n != 0);
17     }
18     return (0);
19