libroot_debug: Merge guarded heap into libroot_debug.
[haiku.git] / src / system / libroot / posix / wchar / wcsrchr.c
blob9c4db9793d45f12afd65dce2c95c2016724ce823
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 __wcsrchr(const wchar_t* wcsIn, wchar_t wc)
12 const wchar_t* wcs = wcsIn + wcslen(wcsIn);
13 for (; wcs >= wcsIn; --wcs) {
14 if (*wcs == wc)
15 return (wchar_t*)wcs;
18 return NULL;
22 B_DEFINE_WEAK_ALIAS(__wcsrchr, wcsrchr);