xref: /haiku/src/system/libroot/posix/wchar/wcsncat.c (revision 68ea01249e1e2088933cb12f9c28d4e5c5d1c9ef)
1 /*
2 ** Copyright 2011, Oliver Tappe, zooey@hirschkaefer.de. All rights reserved.
3 ** Distributed under the terms of the MIT License.
4 */
5 
6 #include <wchar_private.h>
7 
8 
9 wchar_t*
10 __wcsncat(wchar_t* destIn, const wchar_t* src, size_t n)
11 {
12 	wchar_t* dest = destIn;
13 	const wchar_t* srcEnd = src + n;
14 
15 	while (*dest != L'\0')
16 		dest++;
17 	while (src < srcEnd && *src != L'\0')
18 		*dest++ = *src++;
19 	*dest = L'\0';
20 
21 	return destIn;
22 }
23 
24 
25 B_DEFINE_WEAK_ALIAS(__wcsncat, wcsncat);
26