Commit b8691538 authored by Jon Griffiths's avatar Jon Griffiths Committed by Alexandre Julliard

msvcrt: Follow Vista behaviour in wcscpy_s.

parent 288a48fc
......@@ -979,27 +979,21 @@ INT CDECL MSVCRT_wcscpy_s( MSVCRT_wchar_t* wcDest, MSVCRT_size_t numElement, con
{
INT size = 0;
if(!wcDest)
if(!wcDest || !numElement)
return MSVCRT_EINVAL;
wcDest[0] = 0;
if(!wcSrc)
{
wcDest[0] = 0;
return MSVCRT_EINVAL;
}
if(numElement == 0)
{
wcDest[0] = 0;
return MSVCRT_ERANGE;
}
size = strlenW(wcSrc) + 1;
if(size > numElement)
{
wcDest[0] = 0;
return MSVCRT_EINVAL;
return MSVCRT_ERANGE;
}
if(size > numElement)
......
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