mescc: Tinycc support: memcmp.

* mlibc/libc-mes+tcc.c (memcmp): Implement.
This commit is contained in:
Jan Nieuwenhuizen 2017-07-29 11:09:00 +02:00
parent 7d0d3a2221
commit f29479dfa2
1 changed files with 4 additions and 1 deletions

View File

@ -196,7 +196,10 @@ memset (void *s, int c, size_t n)
int
memcmp (void const *s1, void const *s2, size_t n)
{
return 0;
char *a = s1;
char *b = s2;
while (*a == *b && --n) {a++;b++;}
return *a - *b;
}
int