mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:07:47 +00:00
LibC: Add POSIX spec comments for string APIs
This commit is contained in:
parent
0f53e0aaea
commit
11a12c2312
2 changed files with 30 additions and 0 deletions
|
@ -28,6 +28,7 @@ static char foldcase(char ch)
|
|||
return ch;
|
||||
}
|
||||
|
||||
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/strcasecmp.html
|
||||
int strcasecmp(const char* s1, const char* s2)
|
||||
{
|
||||
for (; foldcase(*s1) == foldcase(*s2); ++s1, ++s2) {
|
||||
|
@ -37,6 +38,7 @@ int strcasecmp(const char* s1, const char* s2)
|
|||
return foldcase(*(const unsigned char*)s1) < foldcase(*(const unsigned char*)s2) ? -1 : 1;
|
||||
}
|
||||
|
||||
// https://pubs.opengroup.org/onlinepubs/9699919799/functions/strncasecmp.html
|
||||
int strncasecmp(const char* s1, const char* s2, size_t n)
|
||||
{
|
||||
if (!n)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue