]> git.sur5r.net Git - openldap/blobdiff - libraries/liblutil/memcmp.c
ITS#5129 fix alock_close with Quick mode
[openldap] / libraries / liblutil / memcmp.c
index 3b2957b3e7bc1ba9144865c0200359b4f7bc7a7a..21400fc54dc4678fc46fd43a05e30045962d8004 100644 (file)
@@ -1,7 +1,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2003 The OpenLDAP Foundation.
+ * Copyright 1998-2007 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * Memory Compare
  */
 int
-(memcmp)(const void *v1, const void *v2, int n) 
+(lutil_memcmp)(const void *v1, const void *v2, size_t n) 
 {
     if (n != 0) {
                const unsigned char *s1=v1, *s2=v2;
         do {
-            if (*s1++ != *s2++)
-                return (*--s1 - *--s2);
+            if (*s1++ != *s2++) return *--s1 - *--s2;
         } while (--n != 0);
     }
-    return (0);
+    return 0;
 }