Commit bdf9a9f9 authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

msvcrt: Fixed strncpy_s behavior when count equals 0.

parent 42d75be6
......@@ -598,8 +598,11 @@ int CDECL 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;
......
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