]> git.sur5r.net Git - openldap/blob - libraries/liblutil/memcmp.c
Merge in all devel changes since 2.0-alpha2.
[openldap] / libraries / liblutil / memcmp.c
1 /* $OpenLDAP$ */
2 #include "portable.h"
3
4 #include <ac/string.h>
5
6 /* 
7  * Memory Compare
8  */
9 int
10 (memcmp)(const void *v1, const void *v2, int n) 
11 {
12     if (n != 0) {
13                 const unsigned char *s1=v1, *s2=v2;
14         do {
15             if (*s1++ != *s2++)
16                 return (*--s1 - *--s2);
17         } while (--n != 0);
18     }
19     return (0);
20