mirror of
https://github.com/reactos/reactos.git
synced 2025-07-27 19:51:50 +00:00
[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:
parent
c36ea58f32
commit
739c9a1e77
1 changed files with 4 additions and 1 deletions
|
@ -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);
|
TRACE("(%s %lu %s %lu)\n", dest, numberOfElements, src, count);
|
||||||
|
|
||||||
if(!count)
|
if(!count) {
|
||||||
|
if(dest && numberOfElements)
|
||||||
|
*dest = 0;
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (!MSVCRT_CHECK_PMT(dest != NULL)) return MSVCRT_EINVAL;
|
if (!MSVCRT_CHECK_PMT(dest != NULL)) return MSVCRT_EINVAL;
|
||||||
if (!MSVCRT_CHECK_PMT(src != NULL)) return MSVCRT_EINVAL;
|
if (!MSVCRT_CHECK_PMT(src != NULL)) return MSVCRT_EINVAL;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue