mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 09:34:59 +00:00
LibC: Implement wmemcmp
This commit is contained in:
parent
685045176b
commit
57f0c12b9a
2 changed files with 10 additions and 0 deletions
|
@ -541,4 +541,13 @@ size_t mbsrtowcs(wchar_t* dst, const char** src, size_t len, mbstate_t* ps)
|
|||
// If we are here, we have written `len` wchars, but not reached the null byte.
|
||||
return written;
|
||||
}
|
||||
|
||||
int wmemcmp(const wchar_t* s1, const wchar_t* s2, size_t n)
|
||||
{
|
||||
while (n-- > 0) {
|
||||
if (*s1++ != *s2++)
|
||||
return s1[-1] < s2[-1] ? -1 : 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue