enabling warn format security and some fixes

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
Esteban Papp
2021-08-30 16:10:08 -07:00
parent cdcdcb0777
commit 0df55c3a7f
10 changed files with 15 additions and 21 deletions
@@ -824,9 +824,7 @@ void CLevelSystem::LogLoadingTime()
sChain = " (Chained)";
}
AZStd::string text;
text.format("Game Level Load Time: [%s] Level %s loaded in %.2f seconds%s", vers, m_lastLevelName.c_str(), m_fLastLevelLoadTime, sChain);
gEnv->pLog->Log(text.c_str());
gEnv->pLog->Log("Game Level Load Time: [%s] Level %s loaded in %.2f seconds%s", vers, m_lastLevelName.c_str(), m_fLastLevelLoadTime, sChain);
}
void CLevelSystem::GetMemoryUsage(ICrySizer* pSizer) const
@@ -468,10 +468,7 @@ namespace LegacyLevelSystem
sChain = " (Chained)";
}
AZStd::string text;
text.format(
"Game Level Load Time: [%s] Level %s loaded in %.2f seconds%s", vers, m_lastLevelName.c_str(), m_fLastLevelLoadTime, sChain);
gEnv->pLog->Log(text.c_str());
gEnv->pLog->Log("Game Level Load Time: [%s] Level %s loaded in %.2f seconds%s", vers, m_lastLevelName.c_str(), m_fLastLevelLoadTime, sChain);
}
//////////////////////////////////////////////////////////////////////////
+2 -2
View File
@@ -593,11 +593,11 @@ void CLog::LogPlus(const char* szFormat, ...)
if (bfile)
{
LogToFilePlus(szTemp);
LogToFilePlus("%s", szTemp);
}
if (bconsole)
{
LogToConsolePlus(szTemp);
LogToConsolePlus("%s", szTemp);
}
}
+1 -1
View File
@@ -190,7 +190,7 @@ void CSystem::LogVersion()
#else
strftime(s, 128, "Log Started at %c", today);
#endif
CryLogAlways(s);
CryLogAlways("%s", s);
CryLogAlways("Built on " __DATE__ " " __TIME__);
+2 -2
View File
@@ -376,12 +376,12 @@ void CXConsole::LogChangeMessage(const char* name, const bool isConst, const boo
if (allowChange)
{
gEnv->pLog->LogWarning(logMessage.c_str());
gEnv->pLog->LogWarning("%s", logMessage.c_str());
gEnv->pLog->LogWarning("Modifying marked variables will not be allowed in Release mode!");
}
else
{
gEnv->pLog->LogError(logMessage.c_str());
gEnv->pLog->LogError("%s", logMessage.c_str());
}
}