1WCSNCPY(3) Linux Programmer's Manual WCSNCPY(3)
2
3
4
6 wcsncpy - copy a fixed-size string of wide characters
7
9 #include <wchar.h>
10
11 wchar_t *wcsncpy(wchar_t *dest, const wchar_t *src, size_t n);
12
14 The wcsncpy() function is the wide-character equivalent of the
15 strncpy(3) function. It copies at most n wide characters from the
16 wide-character string pointed to by src, including the terminating null
17 wide character (L'\0'), to the array pointed to by dest. Exactly n
18 wide characters are written at dest. If the length wcslen(src) is
19 smaller than n, the remaining wide characters in the array pointed to
20 by dest are filled with null wide characters. If the length
21 wcslen(src) is greater than or equal to n, the string pointed to by
22 dest will not be terminated by a null wide character.
23
24 The strings may not overlap.
25
26 The programmer must ensure that there is room for at least n wide char‐
27 acters at dest.
28
30 wcsncpy() returns dest.
31
33 For an explanation of the terms used in this section, see
34 attributes(7).
35
36 ┌──────────┬───────────────┬─────────┐
37 │Interface │ Attribute │ Value │
38 ├──────────┼───────────────┼─────────┤
39 │wcsncpy() │ Thread safety │ MT-Safe │
40 └──────────┴───────────────┴─────────┘
42 POSIX.1-2001, POSIX.1-2008, C99.
43
45 strncpy(3)
46
48 This page is part of release 5.02 of the Linux man-pages project. A
49 description of the project, information about reporting bugs, and the
50 latest version of this page, can be found at
51 https://www.kernel.org/doc/man-pages/.
52
53
54
55GNU 2019-03-06 WCSNCPY(3)