]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/userprocess.cpp
m_testcommand deletes its command handler manually, no modules should do this. Will...
[user/henk/code/inspircd.git] / src / userprocess.cpp
index e79c879c2dbeff8b783896358034bfa145131291..3b9e717df2661dcc622b2eaffb5ec7038e9cda79 100644 (file)
@@ -174,7 +174,7 @@ void InspIRCd::ProcessUser(userrec* cu)
 
                if ((result == -1) && (errno != EAGAIN) && (errno != EINTR))
                {
-                       cu->SetWriteError(strerror(errno));
+                       cu->SetWriteError(errno ? strerror(errno) : "EOF from client");
                        return;
                }
        }
@@ -274,9 +274,10 @@ void InspIRCd::DoBackgroundUserStuff(time_t TIME)
                                        {
                                                /* Everybody loves boobies. */
                                                time_t time = this->Time(false) - (curr->nping - curr->pingmax);
-                                               std::string boobies = "Ping timeout: " + ConvToStr(time) + " second" + (time > 1 ? "s" : "");
+                                               char message[MAXBUF];
+                                               snprintf(message, MAXBUF, "Ping timeout: %ld second%s", time, time > 1 ? "s" : "");
                                                curr->muted = true;
-                                               GlobalCulls.AddItem(curr, boobies);
+                                               GlobalCulls.AddItem(curr, message);
                                                curr->lastping = 1;
                                                curr->nping = TIME+curr->pingmax;
                                                continue;