[WINESYNC] msvcrt: Fixed strncpy_s behavior when count equals 0.

wine commit id bdf9a9f9bd56354f70a7431a9682183b84353211 by Piotr Caban <piotr@codeweavers.com>
This commit is contained in:
Timo Kreuzer 2023-01-10 11:36:51 +02:00
parent c36ea58f32
commit 739c9a1e77

View file

@ -819,8 +819,11 @@ int CDECL MSVCRT_strncpy_s(char *dest, MSVCRT_size_t numberOfElements,
TRACE("(%s %lu %s %lu)\n", dest, numberOfElements, src, count);
if(!count)
if(!count) {
if(dest && numberOfElements)
*dest = 0;
return 0;
}
if (!MSVCRT_CHECK_PMT(dest != NULL)) return MSVCRT_EINVAL;
if (!MSVCRT_CHECK_PMT(src != NULL)) return MSVCRT_EINVAL;