mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-14 20:53:35 +00:00
msvcrt: Use the parameter checking macros for strncpy_s.
This commit is contained in:
parent
00f07046c0
commit
c10a6d74d5
|
@ -572,8 +572,7 @@ int CDECL strncpy_s(char *dest, MSVCRT_size_t numberOfElements,
|
|||
if(!count)
|
||||
return 0;
|
||||
|
||||
if(!dest || !src || !numberOfElements) {
|
||||
MSVCRT__invalid_parameter(NULL, NULL, NULL, 0, 0);
|
||||
if (!MSVCRT_CHECK_PMT(dest != NULL) || !MSVCRT_CHECK_PMT(src != NULL) || !MSVCRT_CHECK_PMT(numberOfElements != 0)) {
|
||||
*MSVCRT__errno() = MSVCRT_EINVAL;
|
||||
return MSVCRT_EINVAL;
|
||||
}
|
||||
|
@ -591,7 +590,7 @@ int CDECL strncpy_s(char *dest, MSVCRT_size_t numberOfElements,
|
|||
return 0;
|
||||
}
|
||||
|
||||
MSVCRT__invalid_parameter(NULL, NULL, NULL, 0, 0);
|
||||
MSVCRT_INVALID_PMT("dest[numberOfElements] is too small");
|
||||
dest[0] = '\0';
|
||||
*MSVCRT__errno() = MSVCRT_EINVAL;
|
||||
return MSVCRT_EINVAL;
|
||||
|
|
Loading…
Reference in a new issue