Apparently this was a bad idea

This commit is contained in:
Scott Ehlert 2007-05-04 01:17:13 +00:00
parent dc4c9f0258
commit 006396bc92

View File

@ -102,7 +102,7 @@ void CLog::CreateNewFile()
while (true)
{
snprintf(name, sizeof(name), "%s%cL%02d%02d%03d.log", g_log_dir.c_str(), PATH_SEP_CHAR, curTime->tm_mon + 1, curTime->tm_mday, i);
snprintf(name, sizeof(name), "%s/L%02d%02d%03d.log", g_log_dir.c_str(), curTime->tm_mon + 1, curTime->tm_mday, i);
build_pathname_r(file, sizeof(file)-1, "%s", name);
FILE *pTmpFile = fopen(file, "r"); // open for reading to check whether the file exists
@ -258,7 +258,7 @@ void CLog::LogError(const char *fmt, ...)
va_end(arglst);
FILE *pF = NULL;
snprintf(name, sizeof(name), "%s%cerror_%04d%02d%02d.log", g_log_dir.c_str(), PATH_SEP_CHAR, curTime->tm_year + 1900, curTime->tm_mon + 1, curTime->tm_mday);
snprintf(name, sizeof(name), "%s/error_%04d%02d%02d.log", g_log_dir.c_str(), curTime->tm_year + 1900, curTime->tm_mon + 1, curTime->tm_mday);
build_pathname_r(file, sizeof(file)-1, "%s", name);
pF = fopen(file, "a+");