1WCSNCPY(3P)                POSIX Programmer's Manual               WCSNCPY(3P)
2
3
4

PROLOG

6       This  manual  page is part of the POSIX Programmer's Manual.  The Linux
7       implementation of this interface may differ (consult the  corresponding
8       Linux  manual page for details of Linux behavior), or the interface may
9       not be implemented on Linux.
10

NAME

12       wcpncpy, wcsncpy — copy a fixed-size wide-character string, returning a
13       pointer to its end
14

SYNOPSIS

16       #include <wchar.h>
17
18       wchar_t *wcpncpy(wchar_t restrict *ws1, const wchar_t *restrict ws2,
19           size_t n);
20       wchar_t *wcsncpy(wchar_t *restrict ws1, const wchar_t *restrict ws2,
21           size_t n);
22

DESCRIPTION

24       For  wcsncpy():  The  functionality described on this reference page is
25       aligned with the ISO C standard. Any conflict between the  requirements
26       described  here and the ISO C standard is unintentional. This volume of
27       POSIX.1‐2017 defers to the ISO C standard.
28
29       The wcpncpy() and wcsncpy() functions shall copy not more than n  wide-
30       character codes (wide-character codes that follow a null wide-character
31       code are not copied) from the array pointed to  by  ws2  to  the  array
32       pointed  to  by ws1.  If copying takes place between objects that over‐
33       lap, the behavior is undefined.
34
35       If the array pointed to by ws2  is  a  wide-character  string  that  is
36       shorter than n wide-character codes, null wide-character codes shall be
37       appended to the copy in the array pointed to by ws1, until n wide-char‐
38       acter codes in all are written.
39

RETURN VALUE

41       If any null wide-character codes were written into the destination, the
42       wcpncpy() function shall return the address  of  the  first  such  null
43       wide-character code. Otherwise, it shall return &ws1[n].
44
45       The wcsncpy() function shall return ws1.
46
47       No return values are reserved to indicate an error.
48

ERRORS

50       No errors are defined.
51
52       The following sections are informative.
53

EXAMPLES

55       None.
56

APPLICATION USAGE

58       If  there  is no null wide-character code in the first n wide-character
59       codes of the array pointed to by ws2, the  result  is  not  null-termi‐
60       nated.
61

RATIONALE

63       None.
64

FUTURE DIRECTIONS

66       None.
67

SEE ALSO

69       strncpy(), wcscpy()
70
71       The Base Definitions volume of POSIX.1‐2017, <wchar.h>
72
74       Portions  of  this text are reprinted and reproduced in electronic form
75       from IEEE Std 1003.1-2017, Standard for Information Technology --  Por‐
76       table  Operating System Interface (POSIX), The Open Group Base Specifi‐
77       cations Issue 7, 2018 Edition, Copyright (C) 2018 by the  Institute  of
78       Electrical  and  Electronics Engineers, Inc and The Open Group.  In the
79       event of any discrepancy between this version and the original IEEE and
80       The  Open Group Standard, the original IEEE and The Open Group Standard
81       is the referee document. The original Standard can be  obtained  online
82       at http://www.opengroup.org/unix/online.html .
83
84       Any  typographical  or  formatting  errors that appear in this page are
85       most likely to have been introduced during the conversion of the source
86       files  to  man page format. To report such errors, see https://www.ker
87       nel.org/doc/man-pages/reporting_bugs.html .
88
89
90
91IEEE/The Open Group                  2017                          WCSNCPY(3P)
Impressum