Changed as suggested by Frans Meulenbroeks
This commit is contained in:
parent
3c91208f8c
commit
eabced42ae
@ -9,13 +9,13 @@
|
|||||||
int
|
int
|
||||||
memcmp(const void *s1, const void *s2, size_t n)
|
memcmp(const void *s1, const void *s2, size_t n)
|
||||||
{
|
{
|
||||||
register const char *p1 = s1, *p2 = s2;
|
register const unsigned char *p1 = s1, *p2 = s2;
|
||||||
|
|
||||||
if (n) {
|
if (n) {
|
||||||
n++;
|
n++;
|
||||||
while (--n > 0) {
|
while (--n > 0) {
|
||||||
if (*p1++ == *p2++) continue;
|
if (*p1++ == *p2++) continue;
|
||||||
return (unsigned char) *--p1 - (unsigned char) *--p2;
|
return *--p1 - *--p2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user