Commit c10a6d74 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

msvcrt: Use the parameter checking macros for strncpy_s.

parent 00f07046
......@@ -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;
......
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