1wcpncpy(3) Library Functions Manual wcpncpy(3)
2
3
4
6 wcpncpy - copy a fixed-size string of wide characters, returning a
7 pointer to its end
8
10 Standard C library (libc, -lc)
11
13 #include <wchar.h>
14
15 wchar_t *wcpncpy(wchar_t dest[restrict .n],
16 const wchar_t src[restrict .n],
17 size_t n);
18
19 Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
20
21 wcpncpy():
22 Since glibc 2.10:
23 _POSIX_C_SOURCE >= 200809L
24 Before glibc 2.10:
25 _GNU_SOURCE
26
28 The wcpncpy() function is the wide-character equivalent of the stp‐
29 ncpy(3) function. It copies at most n wide characters from the wide-
30 character string pointed to by src, including the terminating null wide
31 (L'\0'), to the array pointed to by dest. Exactly n wide characters
32 are written at dest. If the length wcslen(src) is smaller than n, the
33 remaining wide characters in the array pointed to by dest are filled
34 with L'\0' characters. If the length wcslen(src) is greater than or
35 equal to n, the string pointed to by dest will not be L'\0' terminated.
36
37 The strings may not overlap.
38
39 The programmer must ensure that there is room for at least n wide char‐
40 acters at dest.
41
43 wcpncpy() returns a pointer to the last wide character written, that
44 is, dest+n-1.
45
47 For an explanation of the terms used in this section, see at‐
48 tributes(7).
49
50 ┌────────────────────────────────────────────┬───────────────┬─────────┐
51 │Interface │ Attribute │ Value │
52 ├────────────────────────────────────────────┼───────────────┼─────────┤
53 │wcpncpy() │ Thread safety │ MT-Safe │
54 └────────────────────────────────────────────┴───────────────┴─────────┘
55
57 POSIX.1-2008.
58
60 stpncpy(3), wcsncpy(3)
61
62
63
64Linux man-pages 6.05 2023-07-20 wcpncpy(3)