diff --git a/src/net_util.cc b/src/net_util.cc index c0bacc98b2..ebe0392e2a 100644 --- a/src/net_util.cc +++ b/src/net_util.cc @@ -322,7 +322,7 @@ const uint32* mask_addr(const uint32* a, uint32 top_bits_to_keep) if ( top_bits_to_keep == 0 || top_bits_to_keep > max_bits ) { - reporter->Error("bad address mask value %s", top_bits_to_keep); + reporter->Error("bad address mask value %u", top_bits_to_keep); return addr; } diff --git a/src/threading/Manager.cc b/src/threading/Manager.cc index ed4d9cf623..d963876755 100644 --- a/src/threading/Manager.cc +++ b/src/threading/Manager.cc @@ -90,7 +90,7 @@ void Manager::Process() else { string s = msg->Name() + " failed, terminating thread"; - reporter->Error(s.c_str()); + reporter->Error("%s", s.c_str()); t->Stop(); } diff --git a/src/threading/MsgThread.cc b/src/threading/MsgThread.cc index e2d81cf47f..d78c7533a3 100644 --- a/src/threading/MsgThread.cc +++ b/src/threading/MsgThread.cc @@ -28,7 +28,7 @@ namespace threading { class TerminateMessage : public InputMessage { public: - TerminateMessage(MsgThread* thread) : InputMessage("Terminate", thread) { } + TerminateMessage(MsgThread* thread) : InputMessage("Terminate", thread) { } virtual bool Process() { return true; } }; @@ -56,7 +56,7 @@ class HeartbeatMessage : public InputMessage { public: HeartbeatMessage(MsgThread* thread, double arg_network_time, double arg_current_time) - : InputMessage("Heartbeat", thread) + : InputMessage("Heartbeat", thread) { network_time = arg_network_time; current_time = arg_current_time; } virtual bool Process() { return Object()->DoHeartbeat(network_time, current_time); } @@ -98,38 +98,36 @@ Message::~Message() bool ReporterMessage::Process() { string s = Object()->Name() + ": " + msg; - strreplace(s, "%", "%%"); - const char* cmsg = s.c_str(); switch ( type ) { case INFO: - reporter->Info(cmsg); + reporter->Info("%s", cmsg); break; case WARNING: - reporter->Warning(cmsg); + reporter->Warning("%s", cmsg); break; case ERROR: - reporter->Error(cmsg); + reporter->Error("%s", cmsg); break; case FATAL_ERROR: - reporter->FatalError(cmsg); + reporter->FatalError("%s", cmsg); break; case FATAL_ERROR_WITH_CORE: - reporter->FatalErrorWithCore(cmsg); + reporter->FatalErrorWithCore("%s", cmsg); break; case INTERNAL_WARNING: - reporter->InternalWarning(cmsg); + reporter->InternalWarning("%s", cmsg); break; case INTERNAL_ERROR : - reporter->InternalError(cmsg); + reporter->InternalError("%s", cmsg); break; default: