msvcrt: Use parameter checking macros in vsn(w)printf_s_l.
This commit is contained in:
parent
4c337fb491
commit
5d4de2ac45
|
@ -1050,7 +1050,7 @@ int CDECL MSVCRT_vsnprintf_s_l( char *str, MSVCRT_size_t sizeOfBuffer,
|
||||||
|
|
||||||
if(ret<0 || ret==len) {
|
if(ret<0 || ret==len) {
|
||||||
if(count!=MSVCRT__TRUNCATE && count>sizeOfBuffer) {
|
if(count!=MSVCRT__TRUNCATE && count>sizeOfBuffer) {
|
||||||
MSVCRT__invalid_parameter( NULL, NULL, NULL, 0, 0 );
|
MSVCRT_INVALID_PMT("str[sizeOfBuffer] is too small");
|
||||||
*MSVCRT__errno() = MSVCRT_ERANGE;
|
*MSVCRT__errno() = MSVCRT_ERANGE;
|
||||||
memset(str, 0, sizeOfBuffer);
|
memset(str, 0, sizeOfBuffer);
|
||||||
} else
|
} else
|
||||||
|
@ -1188,7 +1188,7 @@ int CDECL MSVCRT_vsnwprintf_s_l( MSVCRT_wchar_t *str, MSVCRT_size_t sizeOfBuffer
|
||||||
|
|
||||||
if(ret<0 || ret==len) {
|
if(ret<0 || ret==len) {
|
||||||
if(count!=MSVCRT__TRUNCATE && count>sizeOfBuffer) {
|
if(count!=MSVCRT__TRUNCATE && count>sizeOfBuffer) {
|
||||||
MSVCRT__invalid_parameter( NULL, NULL, NULL, 0, 0 );
|
MSVCRT_INVALID_PMT("str[sizeOfBuffer] is too small");
|
||||||
*MSVCRT__errno() = MSVCRT_ERANGE;
|
*MSVCRT__errno() = MSVCRT_ERANGE;
|
||||||
memset(str, 0, sizeOfBuffer*sizeof(MSVCRT_wchar_t));
|
memset(str, 0, sizeOfBuffer*sizeof(MSVCRT_wchar_t));
|
||||||
} else
|
} else
|
||||||
|
|
Loading…
Reference in New Issue