libroot_debug: Merge guarded heap into libroot_debug.
[haiku.git] / src / system / libroot / posix / wchar / wcslcpy.c
blobfcb206ab7da77750165ba3bd24275f0d2f53d4ff
1 /*
2 ** Copyright 2002, Manuel J. Petit.
3 ** Copyright 2011, Oliver Tappe <zooey@hirschkafer.de>.
4 ** All rights reserved. Distributed under the terms of the NewOS License.
5 */
7 #include <wchar_private.h>
10 size_t
11 __wcslcpy(wchar_t* dest, const wchar_t* source, size_t maxLength)
13 size_t i;
15 if (maxLength == 0)
16 return __wcslen(source);
18 for (i = 0; i < maxLength - 1 && *source != L'\0'; ++i)
19 *dest++ = *source++;
21 *dest++ = 0;
23 return i + __wcslen(source);
27 B_DEFINE_WEAK_ALIAS(__wcslcpy, wcslcpy);