cuserid: support invocation with a null pointer argument
[musl.git] / src / string / memcmp.c
blobbdbce9f0f563cc957b971ef1f2b9dd88421f772a
1 #include <string.h>
3 int memcmp(const void *vl, const void *vr, size_t n)
5 const unsigned char *l=vl, *r=vr;
6 for (; n && *l == *r; n--, l++, r++);
7 return n ? *l-*r : 0;