diff options
| author | 2013-05-06 11:49:50 +0100 | |
|---|---|---|
| committer | 2013-05-15 03:32:56 +0100 | |
| commit | accccc212cd4f08a3c5532b1ae7a17e76bac8718 (patch) | |
| tree | 18f4370778cc79d2f21a4308dafbb29a77cfa213 /src/userprocess.cpp | |
| parent | Merge pull request #523 from SaberUK/master+server-notice (diff) | |
Replace some C-isms with C++-isms.
* 'const char*' to 'const std::string&'.
* snprintf to std::string concatenation.
* Replace duplicated OneOfMatches with InspIRCd::MatchMask.
Diffstat (limited to 'src/userprocess.cpp')
| -rw-r--r-- | src/userprocess.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
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); |
