From accccc212cd4f08a3c5532b1ae7a17e76bac8718 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Mon, 6 May 2013 11:49:50 +0100 Subject: Replace some C-isms with C++-isms. * 'const char*' to 'const std::string&'. * snprintf to std::string concatenation. * Replace duplicated OneOfMatches with InspIRCd::MatchMask. --- src/userprocess.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/userprocess.cpp') diff --git a/src/userprocess.cpp b/src/userprocess.cpp index c78f0bb0b..40fd35c59 100644 --- a/src/userprocess.cpp +++ b/src/userprocess.cpp @@ -66,8 +66,7 @@ void InspIRCd::DoBackgroundUserStuff() if (!curr->lastping) { time_t time = this->Time() - (curr->nping - curr->MyClass->GetPingTime()); - char message[MAXBUF]; - snprintf(message, MAXBUF, "Ping timeout: %ld second%s", (long)time, time > 1 ? "s" : ""); + const std::string message = "Ping timeout: " + ConvToStr(time) + (time == 1 ? " seconds" : " second"); curr->lastping = 1; curr->nping = Time() + curr->MyClass->GetPingTime(); this->Users->QuitUser(curr, message); -- cgit v1.3.1-10-gc9f91