libc: Add strxfrm()

This commit is contained in:
apio 2022-11-06 19:56:36 +01:00
parent 2e9348181d
commit 2eeef9581f
2 changed files with 9 additions and 0 deletions

View File

@ -74,6 +74,9 @@ extern "C"
/* Compares a and b based on the current locale. */
int strcoll(const char* a, const char* b);
/* Transforms src based on the current locale and stores n bytes of it in dest. */
size_t strxfrm(char* dest, const char* src, size_t n);
/* Searches for the needle string in the haystack string. */
char* strstr(const char* haystack, const char* needle);

View File

@ -136,6 +136,12 @@ extern "C"
return strcmp(a, b);
}
size_t strxfrm(char* dest, const char* src, size_t n)
{
strncpy(dest, src, n);
return n;
}
size_t strcspn(const char* str, const char* reject)
{
const char* s = str;