1570af302Sopenharmony_ci#include <wchar.h>
2570af302Sopenharmony_ci
3570af302Sopenharmony_ciwchar_t *wcsncpy(wchar_t *restrict d, const wchar_t *restrict s, size_t n)
4570af302Sopenharmony_ci{
5570af302Sopenharmony_ci	wchar_t *a = d;
6570af302Sopenharmony_ci	while (n && *s) n--, *d++ = *s++;
7570af302Sopenharmony_ci	wmemset(d, 0, n);
8570af302Sopenharmony_ci	return a;
9570af302Sopenharmony_ci}
10