msvcrt: Follow Vista behaviour in wcscpy_s.

This commit is contained in:
Jon Griffiths 2008-05-26 08:21:13 -07:00 committed by Alexandre Julliard
parent 288a48fcf0
commit b86915382d
1 changed files with 4 additions and 10 deletions

View File

@ -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)