DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

wcsncpy(3C)


wcsncpy -- copy a wide character string with bound

Synopsis

#include <wchar.h>

wchar_t *wcsncpy(wchar_t *ws1,const wchar_t *ws2, size_t n);

Description

wcsncpy copies exactly n wide characters, truncating the wide string ws2 or adding null wide characters to ws1, if necessary. Wide characters that follow a null wide character are not copied. The result will not be null-terminated if the length of ws2 is n or more. If the array ws2 points to is a wide character string that is shorter than n wide characters, the copy in the array pointed to by ws1 is padded with null wide characters until a total of n wide characters is written. This function does not check for an overflow condition of the array pointed to by ws1.

Return values

wcsncpy returns ws1.

Usage

Overlapping moves may cause unexpected results because the movement of wide characters is implementation-dependent. If there is no null wide character in the first n wide characters of the array pointed to by ws2, the result will not be null-terminated.

References

wchar(5), wcscpy(3C)
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004