From 4413e54058999d3323a800dd175ebbe4c12e56f7 Mon Sep 17 00:00:00 2001 From: Borja Ferrer Date: Sun, 10 Sep 2006 12:07:01 +0000 Subject: [PATCH] LogType checking is not necessary, LogError is always type 1 --- amxmodx/amxxlog.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/amxmodx/amxxlog.cpp b/amxmodx/amxxlog.cpp index b90b2bd3..7659d57b 100755 --- a/amxmodx/amxxlog.cpp +++ b/amxmodx/amxxlog.cpp @@ -249,7 +249,7 @@ void CLog::LogError(const char *fmt, ...) va_list arglst; va_start(arglst, fmt); - vsnprintf(msg, 3071, fmt, arglst); + vsnprintf(msg, sizeof(msg)-1, fmt, arglst); va_end(arglst); FILE *pF = NULL; @@ -261,14 +261,7 @@ void CLog::LogError(const char *fmt, ...) if (!m_LoggedErrMap) { fprintf(pF, "L %s: Start of error session.\n", date); - if (m_LogType == 1) - { - fprintf(pF, "L %s: Info (map \"%s\") (logfile \"L%02d%02d.log\")\n", date, STRING(gpGlobals->mapname), curTime->tm_mon + 1, curTime->tm_mday); - } else if (m_LogType == 2) { - fprintf(pF, "L %s: Info (map \"%s\") (logfile \"%s\")\n", date, STRING(gpGlobals->mapname), m_LogFile.c_str()); - } else if (m_LogType == 3) { - fprintf(pF, "L %s: Info (map \"%s\") (logfile \"hl\")\n", date, STRING(gpGlobals->mapname)); - } + fprintf(pF, "L %s: Info (map \"%s\") (logfile \"error_%02d%02d%02d.log\")\n", date, STRING(gpGlobals->mapname), curTime->tm_mon + 1, curTime->tm_mday, curTime->tm_year - 100); m_LoggedErrMap = true; } fprintf(pF, "L %s: %s\n", date, msg);