meta: move photon/libc to root
This commit is contained in:
14
libc/string/memcmp.c
Normal file
14
libc/string/memcmp.c
Normal file
@@ -0,0 +1,14 @@
|
||||
#include <stddef.h>
|
||||
|
||||
int memcmp(const void *a, const void *b, size_t n)
|
||||
{
|
||||
const unsigned char *s1 = a, *s2 = b;
|
||||
|
||||
for (size_t i = 0; i < n; i++) {
|
||||
if (s1[i] != s2[i]) {
|
||||
return ((s1[i] < s2[i]) ? -1 : 1);
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user