WCPCPY(3C) Standard C Library Functions WCPCPY(3C)
wcpcpy, wcpncpy - copy a wide-character string and return a pointer to
its end
#include <wchar.h>
wchar_t *
wcpcpy(wchar_t *restrict ws1, const wchar_t *restrict ws2);
wchar_t *
wcpncpy(wchar_t *restrict ws1, const wchar_t *restrict ws2, size_t n);
The wcpcpy() and wcpncpy() functions copy the wide-character string
pointed to by ws2 into the location pointed to by ws1. They stop
copying after a null wide-character is copied, or in the case of
wcpncpy(), after n wide-characters have been copied. If ws2 contains
fewer than n wide-characters, then the wcpncpy() function pads wide-
characters to the end of the destination ws1 until exactly n wide-
characters have been written.
In the case of wcpncpy() a terminating null wide-character will not be
written if the length of ws2 exceeds n.
If ws1 and ws2 overlap, the result is undefined.
The wcpcpy() and wcpncpy() functions are the wide-character equivalents
of stpcpy() and stpncpy(), respectively.
The wcpcpy() and wcpncpy() functions return a pointer to the last wide-
character written. In the case of wcpncpy() this will always be equal
to (ws1 + n - 1).
None.
Standard.
MT-LEVEL
MT-Safe.
stpcpy(3C), stpncpy(3C), wcscpy(3C), wcsncpy(3C), wchar.h(3HEAD),
standards(7)
The wcpcpy() and wcpncpy() functions were introduced in IEEE Std
1003.1-2008 ("POSIX.1").
illumos July 27, 2014 illumos
NAME
wcpcpy, wcpncpy - copy a wide-character string and return a pointer to
its end
SYNOPSIS
#include <wchar.h>
wchar_t *
wcpcpy(wchar_t *restrict ws1, const wchar_t *restrict ws2);
wchar_t *
wcpncpy(wchar_t *restrict ws1, const wchar_t *restrict ws2, size_t n);
DESCRIPTION
The wcpcpy() and wcpncpy() functions copy the wide-character string
pointed to by ws2 into the location pointed to by ws1. They stop
copying after a null wide-character is copied, or in the case of
wcpncpy(), after n wide-characters have been copied. If ws2 contains
fewer than n wide-characters, then the wcpncpy() function pads wide-
characters to the end of the destination ws1 until exactly n wide-
characters have been written.
In the case of wcpncpy() a terminating null wide-character will not be
written if the length of ws2 exceeds n.
If ws1 and ws2 overlap, the result is undefined.
The wcpcpy() and wcpncpy() functions are the wide-character equivalents
of stpcpy() and stpncpy(), respectively.
RETURN VALUES
The wcpcpy() and wcpncpy() functions return a pointer to the last wide-
character written. In the case of wcpncpy() this will always be equal
to (ws1 + n - 1).
ERRORS
None.
INTERFACE STABILITY
Standard.
MT-LEVEL
MT-Safe.
SEE ALSO
stpcpy(3C), stpncpy(3C), wcscpy(3C), wcsncpy(3C), wchar.h(3HEAD),
standards(7)
STANDARDS
The wcpcpy() and wcpncpy() functions were introduced in IEEE Std
1003.1-2008 ("POSIX.1").
illumos July 27, 2014 illumos