/* ** Copyright 2002, Manuel J. Petit. ** Copyright 2011, Oliver Tappe . ** All rights reserved. Distributed under the terms of the NewOS License. */ #include size_t __wcslcpy(wchar_t* dest, const wchar_t* source, size_t maxLength) { size_t i; if (maxLength == 0) return __wcslen(source); for (i = 0; i < maxLength - 1 && *source != L'\0'; ++i) *dest++ = *source++; *dest++ = 0; return i + __wcslen(source); } B_DEFINE_WEAK_ALIAS(__wcslcpy, wcslcpy);