summaryrefslogtreecommitdiff
path: root/src/ToolBox/superpmi/superpmi/methodstatsemitter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ToolBox/superpmi/superpmi/methodstatsemitter.cpp')
-rw-r--r--src/ToolBox/superpmi/superpmi/methodstatsemitter.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/ToolBox/superpmi/superpmi/methodstatsemitter.cpp b/src/ToolBox/superpmi/superpmi/methodstatsemitter.cpp
index 0a43f02dd9..5cebc97db4 100644
--- a/src/ToolBox/superpmi/superpmi/methodstatsemitter.cpp
+++ b/src/ToolBox/superpmi/superpmi/methodstatsemitter.cpp
@@ -50,11 +50,11 @@ void MethodStatsEmitter::Emit(int methodNumber, MethodContext *mc, ULONGLONG fir
if (mc->dumpMethodMD5HashToBuffer(md5Hash, MD5_HASH_BUFFER_SIZE) != MD5_HASH_BUFFER_SIZE)
md5Hash[0] = 0;
- charCount += sprintf(rowData + charCount, "%s,", md5Hash);
+ charCount += sprintf_s(rowData + charCount, _countof(rowData) - charCount, "%s,", md5Hash);
}
if (strchr(statsTypes, '*') != NULL || strchr(statsTypes, 'n') != NULL || strchr(statsTypes, 'N') != NULL)
{
- charCount += sprintf(rowData + charCount, "%d,", methodNumber);
+ charCount += sprintf_s(rowData + charCount, _countof(rowData) - charCount, "%d,", methodNumber);
}
if (strchr(statsTypes, '*') != NULL || strchr(statsTypes, 'i') != NULL || strchr(statsTypes, 'I') != NULL)
{
@@ -63,7 +63,7 @@ void MethodStatsEmitter::Emit(int methodNumber, MethodContext *mc, ULONGLONG fir
unsigned flags = 0;
mc->repCompileMethod(&info, &flags);
- charCount += sprintf(rowData + charCount, "%d,", info.ILCodeSize);
+ charCount += sprintf_s(rowData + charCount, _countof(rowData) - charCount, "%d,", info.ILCodeSize);
}
if (strchr(statsTypes, '*') != NULL || strchr(statsTypes, 'a') != NULL || strchr(statsTypes, 'A') != NULL)
{
@@ -76,11 +76,11 @@ void MethodStatsEmitter::Emit(int methodNumber, MethodContext *mc, ULONGLONG fir
else
codeSize = 0;//this is likely a thin mc
- charCount += sprintf(rowData + charCount, "%d,", codeSize);
+ charCount += sprintf_s(rowData + charCount, _countof(rowData) - charCount, "%d,", codeSize);
}
if (strchr(statsTypes, '*') != NULL || strchr(statsTypes, 't') != NULL || strchr(statsTypes, 'T') != NULL)
{
- charCount += sprintf(rowData + charCount, "%llu,%llu,", firstTime, secondTime);
+ charCount += sprintf_s(rowData + charCount, _countof(rowData) - charCount, "%llu,%llu,", firstTime, secondTime);
}
//get rid of the final ',' and replace it with a '\n'
@@ -105,15 +105,15 @@ void MethodStatsEmitter::SetStatsTypes(char *types)
DWORD bytesWritten = 0;
if (strchr(statsTypes, '*') != NULL || strchr(statsTypes, 'h') != NULL || strchr(statsTypes, 'H') != NULL)
- charCount += sprintf(rowHeader + charCount, "HASH,");
+ charCount += sprintf_s(rowHeader + charCount, _countof(rowHeader) - charCount, "HASH,");
if (strchr(statsTypes, '*') != NULL || strchr(statsTypes, 'n') != NULL || strchr(statsTypes, 'N') != NULL)
- charCount += sprintf(rowHeader + charCount, "METHOD_NUMBER,");
+ charCount += sprintf_s(rowHeader + charCount, _countof(rowHeader) - charCount, "METHOD_NUMBER,");
if (strchr(statsTypes, '*') != NULL || strchr(statsTypes, 'i') != NULL || strchr(statsTypes, 'I') != NULL)
- charCount += sprintf(rowHeader + charCount, "IL_CODE_SIZE,");
+ charCount += sprintf_s(rowHeader + charCount, _countof(rowHeader) - charCount, "IL_CODE_SIZE,");
if (strchr(statsTypes, '*') != NULL || strchr(statsTypes, 'a') != NULL || strchr(statsTypes, 'A') != NULL)
- charCount += sprintf(rowHeader + charCount, "ASM_CODE_SIZE,");
+ charCount += sprintf_s(rowHeader + charCount, _countof(rowHeader) - charCount, "ASM_CODE_SIZE,");
if (strchr(statsTypes, '*') != NULL || strchr(statsTypes, 't') != NULL || strchr(statsTypes, 'T') != NULL)
- charCount += sprintf(rowHeader + charCount, "Time1,Time2,");
+ charCount += sprintf_s(rowHeader + charCount, _countof(rowHeader) - charCount, "Time1,Time2,");
//get rid of the final ',' and replace it with a '\n'
rowHeader[charCount - 1] = '\n';
@@ -123,4 +123,4 @@ void MethodStatsEmitter::SetStatsTypes(char *types)
LogError("Failed to write row header '%s'. GetLastError()=%u", rowHeader, GetLastError());
}
}
-} \ No newline at end of file
+}