Fixed crashes (on VS at least) when the string printed contained

format characters.
This commit is contained in:
hiker 2016-03-06 15:54:39 +11:00
parent ab641b0dad
commit f70dfb7d5d
2 changed files with 2 additions and 2 deletions

View File

@ -201,7 +201,7 @@ void Network::logPacket(const BareNetworkString &ns, bool incoming)
// Indentation for all lines after the first, so that the dump
// is nicely aligned.
std::string indent(" ");
fprintf(m_log_file.getData(), ns.getLogMessage(indent).c_str());
fprintf(m_log_file.getData(), "%s", ns.getLogMessage(indent).c_str());
m_log_file.unlock();
} // logPacket
// ----------------------------------------------------------------------------

View File

@ -547,7 +547,7 @@ void* STKHost::mainLoop(void* self)
Log::verbose("NetworkManager",
"Message, Sender : %s, message:",
stk_addr.toString(/*show port*/false).c_str());
Log::verbose("NetworkManager",
Log::verbose("NetworkManager", "%s",
stk_event->data().getLogMessage().c_str());
} // if message event