From d84ef62e6c5f3e578d1bce0ec87e6a1c3e973182 Mon Sep 17 00:00:00 2001 From: Borja Ferrer Date: Sun, 19 Mar 2006 20:39:25 +0000 Subject: [PATCH] little optimization from PM --- amxmodx/amxxlog.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/amxmodx/amxxlog.cpp b/amxmodx/amxxlog.cpp index 5251a5f3..9ff4d801 100755 --- a/amxmodx/amxxlog.cpp +++ b/amxmodx/amxxlog.cpp @@ -97,8 +97,8 @@ void CLog::CreateNewFile() while (true) { - m_LogFile.assign(build_pathname_r(file, sizeof(file)-1, "%s/L%02d%02d%03d.log", g_log_dir.c_str(), curTime->tm_mon + 1, curTime->tm_mday, i)); - FILE *pTmpFile = fopen(m_LogFile.c_str(), "r"); // open for reading to check whether the file exists + build_pathname_r(file, sizeof(file)-1, "%s/L%02d%02d%03d.log", g_log_dir.c_str(), curTime->tm_mon + 1, curTime->tm_mday, i); + FILE *pTmpFile = fopen(file, "r"); // open for reading to check whether the file exists if (!pTmpFile) break; @@ -106,6 +106,7 @@ void CLog::CreateNewFile() fclose(pTmpFile); ++i; } + m_LogFile.assign(file); // Log logfile start FILE *fp = fopen(m_LogFile.c_str(), "w");