File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed
Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -10585,15 +10585,19 @@ const char* Compiler::devirtualizationDetailToString(CORINFO_DEVIRTUALIZATION_DE
1058510585//
1058610586const char * Compiler::printfAlloc (const char * format, ...)
1058710587{
10588- char str[512 ];
1058910588 va_list args;
1059010589 va_start (args, format);
10591- int result = vsprintf_s (str, ArrLen (str), format, args);
10590+ int count = _vscprintf ( format, args);
1059210591 va_end (args);
10593- assert ((result >= 0 ) && ((unsigned )result < ArrLen (str)));
1059410592
10595- char * resultStr = new (this , CMK_DebugOnly) char [result + 1 ];
10596- memcpy (resultStr, str, (unsigned )result + 1 );
10593+ assert (count >= 0 );
10594+ char * resultStr = new (this , CMK_DebugOnly) char [count + 1 ];
10595+
10596+ va_start (args, format);
10597+ int result = vsprintf_s (resultStr, count + 1 , format, args);
10598+ va_end (args);
10599+
10600+ assert ((result >= 0 ) && (result < (count + 1 )));
1059710601 return resultStr;
1059810602}
1059910603
You can’t perform that action at this time.
0 commit comments