string: fix strncmcp

This commit is contained in:
Matheus
2025-10-03 19:29:40 -03:00
parent 7669af39ea
commit e04ec29c48
+3 -2
View File
@@ -68,8 +68,9 @@ size_t strlen(const char *a) {
int strncmp(const char *a, const char *b, size_t c) {
int diff = 0;
while (c-- && diff == 0)
diff += *a++ - *b++;
while (c-- && diff == 0 && *a) {
diff += *a++ - *b++;
}
return diff;
}