PatchworkOS
Loading...
Searching...
No Matches
strxfrm.c
Go to the documentation of this file.
1#include <string.h>
2
3size_t strxfrm(char* _RESTRICT s1, const char* _RESTRICT s2, size_t n)
4{
5 size_t len = strlen(s2);
6
7 if (len < n)
8 {
9 /* Cannot use strncpy() here as the filling of s1 with '\0' is not part
10 of the spec.
11 */
12 /* FIXME: This should access _pdclib_lc_collate. */
13 while (n-- && (*s1++ = (unsigned char)*s2++))
14 {
15 /* EMPTY */
16 }
17 }
18
19 return len;
20}
#define _RESTRICT
Definition config.h:17
_PUBLIC size_t strlen(const char *s)
Definition strlen.c:3
size_t strxfrm(char *_RESTRICT s1, const char *_RESTRICT s2, size_t n)
Definition strxfrm.c:3