1WCSNCPY(3)                 Linux Programmer's Manual                WCSNCPY(3)
2
3
4

NAME

6       wcsncpy - copy a fixed-size string of wide characters
7

SYNOPSIS

9       #include <wchar.h>
10
11       wchar_t *wcsncpy(wchar_t *restrict dest, const wchar_t *restrict src,
12                        size_t n);
13

DESCRIPTION

15       The   wcsncpy()  function  is  the  wide-character  equivalent  of  the
16       strncpy(3) function.  It copies at most  n  wide  characters  from  the
17       wide-character string pointed to by src, including the terminating null
18       wide character (L'\0'), to the array pointed to  by  dest.   Exactly  n
19       wide  characters  are  written  at  dest.  If the length wcslen(src) is
20       smaller than n, the remaining wide characters in the array  pointed  to
21       by  dest  are  filled  with  null  wide  characters.  If the length wc‐
22       slen(src) is greater than or equal to n, the string pointed to by  dest
23       will not be terminated by a null wide character.
24
25       The strings may not overlap.
26
27       The programmer must ensure that there is room for at least n wide char‐
28       acters at dest.
29

RETURN VALUE

31       wcsncpy() returns dest.
32

ATTRIBUTES

34       For an  explanation  of  the  terms  used  in  this  section,  see  at‐
35       tributes(7).
36
37       ┌────────────────────────────────────────────┬───────────────┬─────────┐
38Interface                                   Attribute     Value   
39       ├────────────────────────────────────────────┼───────────────┼─────────┤
40wcsncpy()                                   │ Thread safety │ MT-Safe │
41       └────────────────────────────────────────────┴───────────────┴─────────┘
42

CONFORMING TO

44       POSIX.1-2001, POSIX.1-2008, C99.
45

SEE ALSO

47       strncpy(3)
48

COLOPHON

50       This  page  is  part of release 5.12 of the Linux man-pages project.  A
51       description of the project, information about reporting bugs,  and  the
52       latest     version     of     this    page,    can    be    found    at
53       https://www.kernel.org/doc/man-pages/.
54
55
56
57GNU                               2021-03-22                        WCSNCPY(3)
Impressum