2 char *_PDCLIB_restrict _Dst,
3 const char *_PDCLIB_restrict _Src,
6 This file is part of the Public Domain C Library (PDCLib).
7 Permission is granted to use, modify, and / or redistribute at will.
14 #pragma weak strlcpy = _PDCLIB_strlcpy
15 size_t _PDCLIB_strlcpy(
17 const char *restrict src,
20 size_t _PDCLIB_strlcpy(
22 const char *restrict src,
26 while(needed < dstsize && (dst[needed] = src[needed]))
31 if (needed > dstsize && dstsize)
40 #include <_PDCLIB_test.h>
45 TESTCASE_NOREG( strlcpy(NULL, "a", 0) == 2 );
46 TESTCASE_NOREG( strlcpy(destbuf, "a", 10) == 2 );
47 TESTCASE_NOREG( strcmp(destbuf, "a") == 0 );
48 TESTCASE_NOREG( strlcpy(destbuf, "helloworld", 10) == 11 );
49 TESTCASE_NOREG( strcmp(destbuf, "helloworl") == 0 );