@@ -664,7 +664,7 @@ void TimeStats::printTime( ShaderType type, ShaderHash hash, void* context ) con
664
664
void TimeStats::printSumTime () const
665
665
{
666
666
// If using regkey to turn on timestats, CorpusName is not initialized properly
667
- if (strlen (IGC::Debug::GetShaderCorpusName ()) == 0 )
667
+ if (sizeof (IGC::Debug::GetShaderCorpusName ()) == 0 )
668
668
{
669
669
std::stringstream corpusName;
670
670
corpusName << m_totalShaderCount << " shaders" ;
@@ -1040,11 +1040,11 @@ void TimeStats::printTimeCSV( std::string const& corpusName ) const
1040
1040
IGC_ASSERT_MESSAGE (m_isPostProcessed, " Print functions should only be called on a Post-Processed TimeStats object" );
1041
1041
1042
1042
std::string subFile = " TimeStat_" ;
1043
- if (strlen (IGC::Debug::GetShaderCorpusName ()) == 0 )
1043
+ if (sizeof (IGC::Debug::GetShaderCorpusName ()) == 0 )
1044
1044
subFile += " Shaders" ;
1045
1045
else
1046
1046
subFile += IGC::Debug::GetShaderCorpusName ();
1047
- const std::string outputFilePath =
1047
+ const std::string outputFilePath =
1048
1048
#if defined(__linux__)
1049
1049
subFile + " .csv" ;
1050
1050
#else
@@ -1104,7 +1104,7 @@ void TimeStats::printPerPassTimeCSV(std::string const& corpusName) const
1104
1104
}
1105
1105
1106
1106
std::string subFile = " TimeStatPerPass_" ;
1107
- if (strlen (IGC::Debug::GetShaderCorpusName ()) == 0 )
1107
+ if (sizeof (IGC::Debug::GetShaderCorpusName ()) == 0 )
1108
1108
subFile += " Shaders" ;
1109
1109
else
1110
1110
subFile += IGC::Debug::GetShaderCorpusName ();
@@ -1267,7 +1267,8 @@ void CMemoryReport::DumpMemoryStats( ShaderType type, ShaderHash hash )
1267
1267
shaderName = shaderName.substr (shaderName.find_last_of (" \\ " ) + 1 , shaderName.size ());
1268
1268
}
1269
1269
1270
- sprintf (m_DumpMemoryStatsFileName, " %s" , shaderName.c_str ());
1270
+ sprintf_s (m_DumpMemoryStatsFileName, sizeof (m_DumpMemoryStatsFileName),
1271
+ " %s" , shaderName.c_str ());
1271
1272
1272
1273
iSTD::FileWrite ( csvFileGlobal, " %s,%u" , m_DumpMemoryStatsFileName, g_MemoryReport.m_Stat .HeapUsedPeak /1024 );
1273
1274
iSTD::FileWrite ( csvFileAllocs, " %s,%u" , m_DumpMemoryStatsFileName, g_MemoryReport.m_Stat .NumAllocations );
0 commit comments