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
11

NAME

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

SYNOPSIS

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

DESCRIPTION

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

RETURN VALUE

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

ERRORS

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

EXAMPLES

56       None.
57

APPLICATION USAGE

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

RATIONALE

64       None.
65

FUTURE DIRECTIONS

67       None.
68

SEE ALSO

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