Fix signedness issues with strcmp and strncmp #4

Merged
Lephenixnoir merged 2 commits from Heath123/fxlibc:heath123-patch-1 into master 2022-11-24 14:23:22 +01:00
1 changed files with 1 additions and 1 deletions
Showing only changes of commit ee42660ea5 - Show all commits

View File

@ -7,5 +7,5 @@ int strncmp(const char *s1, const char *s2, size_t n)
size_t i = -1;
while (++i < n - 1 && s1[i] != '\0' && s2[i] != '\0'
&& s1[i] == s2[i]) ;
return (s1[i] - s2[i]);
return ((unsigned char) s1[i] - (unsigned char) s2[i]);
}