Back to index

openldap  2.4.31
Functions
memcmp.c File Reference
#include "portable.h"
#include <ac/string.h>

Go to the source code of this file.

Functions

int() lutil_memcmp (const void *v1, const void *v2, size_t n)

Function Documentation

int() lutil_memcmp ( const void v1,
const void v2,
size_t  n 
)

Definition at line 24 of file memcmp.c.

{
    if (n != 0) {
              const unsigned char *s1=v1, *s2=v2;
        do {
            if (*s1++ != *s2++) return *--s1 - *--s2;
        } while (--n != 0);
    }
    return 0;
}