fxlibc/src/libc/string/strcmp.c

11 lines
166 B
C
Raw Normal View History

2021-05-09 17:34:00 +02:00
#include <string.h>
2020-09-17 19:27:01 +02:00
int strcmp(const char *s1, const char *s2)
{
while (*s1 != '\0' && *s2 != '\0' && *s1 == *s2) {
2020-09-17 19:27:01 +02:00
s1 += 1;
s2 += 1;
}
return (*s1 - *s2);
}