From 8b6f0f699df121f4e19b579a65504c3cb3287a37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20W=2E=20Urba=C5=84czyk?= Date: Thu, 10 Nov 2011 13:03:45 +0000 Subject: [PATCH] [programming challenge] More. --- VCMI_BattleAiHost/main.cpp | 3 ++- server/CVCMIServer.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/VCMI_BattleAiHost/main.cpp b/VCMI_BattleAiHost/main.cpp index de63419b9..923ac65b3 100644 --- a/VCMI_BattleAiHost/main.cpp +++ b/VCMI_BattleAiHost/main.cpp @@ -39,7 +39,8 @@ int main(int argc, char** argv) initDLL(console,logfile); - logfile = new std::ofstream((logDir + "/" + "VCMI_Runner_log_" + boost::lexical_cast(pid) + ".txt").c_str()); + std::string logName = logDir + "/" + "VCMI_Runner_log_" + boost::lexical_cast(pid) + ".txt"; + logfile = new std::ofstream(logName.c_str()); try { diff --git a/server/CVCMIServer.cpp b/server/CVCMIServer.cpp index 14cc9c33e..134bc108d 100644 --- a/server/CVCMIServer.cpp +++ b/server/CVCMIServer.cpp @@ -680,7 +680,8 @@ int main(int argc, char** argv) if(argc >= 6) LOGS_DIR = argv[5]; - logfile = new std::ofstream(LOGS_DIR + "/" + "VCMI_Server_log.txt"); + std::string logName = LOGS_DIR + "/" + "VCMI_Server_log.txt"; + logfile = new std::ofstream(logName.c_str()); console = new CConsoleHandler; //boost::thread t(boost::bind(&CConsoleHandler::run,::console));