— copy wide strings
* restrict dst, const
wchar_t * restrict src);
wcsncpy(wchar_t * restrict dst,
const wchar_t * restrict src, size_t
wcsncpy() functions copy the wide string
src to dst (including the
terminating null wide character).
function copies not more than len wide characters to
dst, appending null wide characters if the length of
src is less than len, and
terminating dst if the length of
src is greater than or equal to
If the src and dst strings overlap, the behavior is undefined.
wcsncpy() functions return
strcpy(3), strlcpy(3), wcscat(3), wcslcpy(3), wmemcpy(3), wmemmove(3)
wcsncpy() functions conform to
ISO/IEC 9899:1999 (“ISO C99”)
and were first introduced in ISO/IEC 9899/AMD1:1995
(“ISO C90, Amendment 1”).
wcsncpy() functions were ported from
NetBSD and first appeared in
Using the functions
wcsncpy() is very error-prone with respect to buffer
overflows; see the EXAMPLES section in
strncpy(3) for correct usage. Using
wcslcpy(3) is a better choice in most cases.