1 /* wchar_t * wcsncpy( wchar_t restrict *, const wchar_t restrict * , size_t );
\r
3 This file is part of the Public Domain C Library (PDCLib).
\r
4 Permission is granted to use, modify, and / or redistribute at will.
\r
11 wchar_t *wcsncpy( wchar_t * _PDCLIB_restrict s1,
\r
12 const wchar_t * _PDCLIB_restrict s2,
\r
16 while ( ( n > 0 ) && ( *s1++ = *s2++ ) )
\r
18 /* Cannot do "n--" in the conditional as size_t is unsigned and we have
\r
19 to check it again for >0 in the next loop below, so we must not risk
\r
24 /* Checking against 1 as we missed the last --n in the loop above. */
\r
36 #include <_PDCLIB_test.h>
\r
40 return TEST_RESULTS;
\r