libroot_debug: Merge guarded heap into libroot_debug.
[haiku.git] / src / system / libroot / posix / wchar / wcsncat.c
blob1fc39fb1ba89e78dd4326e913e8c2cb384c9939e
1 /*
2 ** Copyright 2011, Oliver Tappe, zooey@hirschkaefer.de. All rights reserved.
3 ** Distributed under the terms of the Haiku License.
4 */
6 #include <wchar_private.h>
9 wchar_t*
10 __wcsncat(wchar_t* destIn, const wchar_t* src, size_t n)
12 wchar_t* dest = destIn;
13 const wchar_t* srcEnd = src + n;
15 while (*dest != L'\0')
16 dest++;
17 while (src < srcEnd && *src != L'\0')
18 *dest++ = *src++;
19 *dest = L'\0';
21 return destIn;
25 B_DEFINE_WEAK_ALIAS(__wcsncat, wcsncat);