mirror of
https://github.com/reactos/wine.git
synced 2025-02-21 21:32:01 +00:00
msvcrt: Fixed strncpy_s behavior when count equals 0.
This commit is contained in:
parent
42d75be69d
commit
bdf9a9f9bd
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user