msvcrt: Use parameter validation macros for mcstowcs_s_l.

This commit is contained in:
Eric Pouech 2010-10-29 15:39:08 +02:00 committed by Alexandre Julliard
parent c10a6d74d5
commit 8583bd317e
1 changed files with 2 additions and 3 deletions

View File

@ -1824,8 +1824,7 @@ int CDECL MSVCRT__mbstowcs_s_l(MSVCRT_size_t *ret, MSVCRT_wchar_t *wcstr,
return 0;
}
if(!mbstr || !wcstr) {
MSVCRT__invalid_parameter(NULL, NULL, NULL, 0, 0);
if(!MSVCRT_CHECK_PMT(mbstr != NULL) || !MSVCRT_CHECK_PMT(wcstr != NULL)) {
if(wcstr && size)
wcstr[0] = '\0';
*MSVCRT__errno() = MSVCRT_EINVAL;
@ -1843,7 +1842,7 @@ int CDECL MSVCRT__mbstowcs_s_l(MSVCRT_size_t *ret, MSVCRT_wchar_t *wcstr,
else if(conv==size && (count==MSVCRT__TRUNCATE || wcstr[conv-1]=='\0'))
wcstr[conv-1] = '\0';
else {
MSVCRT__invalid_parameter(NULL, NULL, NULL, 0, 0);
MSVCRT_INVALID_PMT("wcstr[size] is too small");
if(size)
wcstr[0] = '\0';
*MSVCRT__errno() = MSVCRT_ERANGE;