xref: /haiku/src/system/libroot/posix/wchar/wcsnlen.c (revision fce4895d1884da5ae6fb299d23c735c598e690b1)
1 /*
2 ** Copyright 2011, Oliver Tappe, zooey@hirschkaefer.de. All rights reserved.
3 ** Distributed under the terms of the Haiku License.
4 */
5 
6 #include <wchar_private.h>
7 
8 
9 size_t
10 __wcsnlen(const wchar_t* wcs, size_t maxLength)
11 {
12 	size_t length = 0;
13 
14 	while (length < maxLength && *wcs++ != L'\0')
15 		length++;
16 
17 	return length;
18 }
19 
20 
21 B_DEFINE_WEAK_ALIAS(__wcsnlen, wcsnlen);
22