msvcrt: Correctly terminate string in wcsncat_s.

This commit is contained in:
Piotr Caban 2011-03-30 15:45:21 +02:00 committed by Alexandre Julliard
parent fdffe548f1
commit da4ed47076
1 changed files with 1 additions and 1 deletions

View File

@ -1716,7 +1716,7 @@ INT CDECL MSVCRT_wcsncat_s(MSVCRT_wchar_t *dst, MSVCRT_size_t elem,
if (srclen < (elem - dststart)) if (srclen < (elem - dststart))
{ {
memcpy(&dst[dststart], src, srclen*sizeof(MSVCRT_wchar_t)); memcpy(&dst[dststart], src, srclen*sizeof(MSVCRT_wchar_t));
dst[srclen] = '\0'; dst[dststart+srclen] = '\0';
return ret; return ret;
} }
MSVCRT_INVALID_PMT("dst[elem] is too small"); MSVCRT_INVALID_PMT("dst[elem] is too small");