mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-29 12:23:30 +00:00
18 lines
305 B
C
18 lines
305 B
C
/* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
|
|
#include <string.h>
|
|
|
|
int
|
|
memcmp(const void *s1, const void *s2, size_t n)
|
|
{
|
|
if (n != 0)
|
|
{
|
|
const unsigned char *p1 = s1, *p2 = s2;
|
|
|
|
do {
|
|
if (*p1++ != *p2++)
|
|
return (*--p1 - *--p2);
|
|
} while (--n != 0);
|
|
}
|
|
return 0;
|
|
}
|