aboutsummaryrefslogtreecommitdiff
path: root/src/locale/wcsxfrm.c
blob: 5f76e5a7b27c3e32e123e8ce74369c445631d812 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#include <wchar.h>

/* collate only by code points */
size_t wcsxfrm(wchar_t *dest, const wchar_t *src, size_t n)
{
	size_t l = wcslen(src);
	if (l >= n) {
		wmemcpy(dest, src, n-1);
		dest[n-1] = 0;
	} else wcscpy(dest, src);
	return l;
}