strxfrm.c 444 字节
Newer Older
R
Rich Felker 已提交
1
#include <string.h>
2
#include <locale.h>
3
#include "locale_impl.h"
4
#include "libc.h"
R
Rich Felker 已提交
5 6

/* collate only by code points */
7
size_t __strxfrm_l(char *restrict dest, const char *restrict src, size_t n, locale_t loc)
R
Rich Felker 已提交
8 9 10 11 12
{
	size_t l = strlen(src);
	if (n > l) strcpy(dest, src);
	return l;
}
13 14 15

size_t strxfrm(char *restrict dest, const char *restrict src, size_t n)
{
16
	return __strxfrm_l(dest, src, n, CURRENT_LOCALE);
17 18 19
}

weak_alias(__strxfrm_l, strxfrm_l);