From 760e6d30174964085ce2b92ecd1b5a7b7080c555 Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 30 Dec 2005 00:48:43 +0000 Subject: [PATCH] Optimized out some more redundant va_args voodoo git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@2706 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspircd.cpp | 2 +- src/inspircd_io.cpp | 2 +- src/modules.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/inspircd.cpp b/src/inspircd.cpp index ed1c8fda8..730e7fea0 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -337,7 +337,7 @@ bool InspIRCd::LoadModule(const char* filename) { char modfile[MAXBUF]; #ifdef STATIC_LINK - snprintf(modfile,MAXBUF,"%s",filename); + strlcpy(modfile,filename,MAXBUF); #else snprintf(modfile,MAXBUF,"%s/%s",Config->ModPath,filename); #endif diff --git a/src/inspircd_io.cpp b/src/inspircd_io.cpp index dd5b14692..42ae122e8 100644 --- a/src/inspircd_io.cpp +++ b/src/inspircd_io.cpp @@ -677,7 +677,7 @@ bool ServerConfig::LoadConf(const char* filename, std::stringstream *target, std } snprintf(newconf,10240,"%s/%s",confpath,buf); } - else snprintf(newconf,10240,"%s",buf); + else strlcpy(newconf,buf,10240); std::stringstream merge(stringstream::in | stringstream::out); // recursively call LoadConf and get the new data, use the same errorstream if (LoadConf(newconf, &merge, errorstream)) diff --git a/src/modules.cpp b/src/modules.cpp index 87df6bdfc..d76f20f5f 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -454,7 +454,7 @@ void Server::SendTo(userrec* Source, userrec* Dest, std::string s) void Server::SendChannelServerNotice(std::string ServName, chanrec* Channel, std::string text) { - WriteChannelWithServ((char*)ServName.c_str(), Channel, "%s", text.c_str()); + WriteChannelWithServ_NoFormat((char*)ServName.c_str(), Channel, text.c_str()); } void Server::SendChannel(userrec* User, chanrec* Channel, std::string s,bool IncludeSender) -- 2.39.5