mirror of
https://github.com/kbeckmann/game-and-watch-retro-go.git
synced 2025-12-16 13:15:55 +01:00
23 lines
328 B
C
23 lines
328 B
C
#ifdef HAVE_CONFIG_H
|
|
#include "config.h"
|
|
#endif
|
|
|
|
#include <stdlib.h>
|
|
|
|
int memcmp(const void *__s1, const void *__s2, size_t __n)
|
|
{
|
|
const char *scan1, *scan2;
|
|
size_t n;
|
|
|
|
scan1 = __s1;
|
|
scan2 = __s2;
|
|
for (n = __n; n > 0; n--)
|
|
if (*scan1 == *scan2) {
|
|
scan1++;
|
|
scan2++;
|
|
} else
|
|
return *scan1 - *scan2;
|
|
|
|
return 0;
|
|
}
|