fxlibc/src/string/strcmp.c

11 lines
198 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;
}
2022-11-24 13:36:02 +01:00
return ((unsigned char) *s1 - (unsigned char) *s2);
2020-09-17 19:27:01 +02:00
}