diff options
author | Adam <adam@sigterm.info> | 2013-05-15 12:33:47 -0700 |
---|---|---|
committer | Adam <adam@sigterm.info> | 2013-05-15 12:33:47 -0700 |
commit | e586aaab7c4f7b03514c83451d73b73f55dc6998 (patch) | |
tree | 18f4370778cc79d2f21a4308dafbb29a77cfa213 /src/usermanager.cpp | |
parent | 23e8bba13c55d33ce89d505780da36c9589e300a (diff) | |
parent | accccc212cd4f08a3c5532b1ae7a17e76bac8718 (diff) |
Merge pull request #531 from SaberUK/master+snprintf-removal
Replace some C-isms with C++-isms.
Diffstat (limited to 'src/usermanager.cpp')
-rw-r--r-- | src/usermanager.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/usermanager.cpp b/src/usermanager.cpp index ba1f5f9e6..8ed87a338 100644 --- a/src/usermanager.cpp +++ b/src/usermanager.cpp @@ -326,18 +326,17 @@ void UserManager::ServerNoticeAll(const char* text, ...) return; char textbuffer[MAXBUF]; - char formatbuffer[MAXBUF]; va_list argsPtr; va_start (argsPtr, text); vsnprintf(textbuffer, MAXBUF, text, argsPtr); va_end(argsPtr); - snprintf(formatbuffer,MAXBUF,"NOTICE $%s :%s", ServerInstance->Config->ServerName.c_str(), textbuffer); + const std::string message = "NOTICE $" + ServerInstance->Config->ServerName + " :" + textbuffer; for (LocalUserList::const_iterator i = local_users.begin(); i != local_users.end(); i++) { User* t = *i; - t->WriteServ(std::string(formatbuffer)); + t->WriteServ(message); } } @@ -347,18 +346,17 @@ void UserManager::ServerPrivmsgAll(const char* text, ...) return; char textbuffer[MAXBUF]; - char formatbuffer[MAXBUF]; va_list argsPtr; va_start (argsPtr, text); vsnprintf(textbuffer, MAXBUF, text, argsPtr); va_end(argsPtr); - snprintf(formatbuffer,MAXBUF,"PRIVMSG $%s :%s", ServerInstance->Config->ServerName.c_str(), textbuffer); + const std::string message = "PRIVMSG $" + ServerInstance->Config->ServerName + " :" + textbuffer; for (LocalUserList::const_iterator i = local_users.begin(); i != local_users.end(); i++) { User* t = *i; - t->WriteServ(std::string(formatbuffer)); + t->WriteServ(message); } } |