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

NAME

6       wcpncpy  -  copy  a  fixed-size  string of wide characters, returning a
7       pointer to its end
8

SYNOPSIS

10       #include <wchar.h>
11
12       wchar_t *wcpncpy(wchar_t *restrict dest, const wchar_t *restrict src,
13                        size_t n);
14
15   Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
16
17       wcpncpy():
18           Since glibc 2.10:
19               _POSIX_C_SOURCE >= 200809L
20           Before glibc 2.10:
21               _GNU_SOURCE
22

DESCRIPTION

24       The wcpncpy() function is the wide-character  equivalent  of  the  stp‐
25       ncpy(3)  function.   It copies at most n wide characters from the wide-
26       character string pointed to by src, including the terminating null wide
27       (L'\0'),  to  the  array pointed to by dest.  Exactly n wide characters
28       are written at dest.  If the length wcslen(src) is smaller than n,  the
29       remaining  wide  characters  in the array pointed to by dest are filled
30       with L'\0' characters.  If the length wcslen(src) is  greater  than  or
31       equal to n, the string pointed to by dest will not be L'\0' terminated.
32
33       The strings may not overlap.
34
35       The programmer must ensure that there is room for at least n wide char‐
36       acters at dest.
37

RETURN VALUE

39       wcpncpy() returns a pointer to the last wide  character  written,  that
40       is, dest+n-1.
41

ATTRIBUTES

43       For  an  explanation  of  the  terms  used  in  this  section,  see at‐
44       tributes(7).
45
46       ┌────────────────────────────────────────────┬───────────────┬─────────┐
47Interface                                   Attribute     Value   
48       ├────────────────────────────────────────────┼───────────────┼─────────┤
49wcpncpy()                                   │ Thread safety │ MT-Safe │
50       └────────────────────────────────────────────┴───────────────┴─────────┘
51

CONFORMING TO

53       POSIX.1-2008.
54

SEE ALSO

56       stpncpy(3), wcsncpy(3)
57

COLOPHON

59       This page is part of release 5.12 of the Linux  man-pages  project.   A
60       description  of  the project, information about reporting bugs, and the
61       latest    version    of    this    page,    can     be     found     at
62       https://www.kernel.org/doc/man-pages/.
63
64
65
66GNU                               2021-03-22                        WCPNCPY(3)
Impressum