Commit 09699142 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

msvcrt: Implemented wcsncpy_s.

parent 6d652ddc
......@@ -772,6 +772,7 @@
@ cdecl wcsncat(wstr wstr long) ntdll.wcsncat
@ cdecl wcsncmp(wstr wstr long) ntdll.wcsncmp
@ cdecl wcsncpy(ptr wstr long) ntdll.wcsncpy
@ cdecl wcsncpy_s(ptr long wstr long) MSVCRT_wcsncpy_s
@ cdecl wcspbrk(wstr wstr) MSVCRT_wcspbrk
@ cdecl wcsrchr(wstr long) ntdll.wcsrchr
@ cdecl wcsspn(wstr wstr) ntdll.wcsspn
......
......@@ -1046,3 +1046,34 @@ INT CDECL MSVCRT_wcscpy_s( MSVCRT_wchar_t* wcDest, MSVCRT_size_t numElement, con
return 0;
}
/******************************************************************
* wcsncpy_s (MSVCRT.@)
*/
INT CDECL MSVCRT_wcsncpy_s( MSVCRT_wchar_t* wcDest, MSVCRT_size_t numElement, const MSVCRT_wchar_t *wcSrc,
MSVCRT_size_t count )
{
INT size = 0;
if (!wcDest || !numElement)
return MSVCRT_EINVAL;
wcDest[0] = 0;
if (!wcSrc)
{
return MSVCRT_EINVAL;
}
size = min(strlenW(wcSrc), count);
if (size >= numElement)
{
return MSVCRT_ERANGE;
}
memcpy( wcDest, wcSrc, size*sizeof(WCHAR) );
wcDest[size] = '\0';
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment