diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-09-25 21:58:32 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-09-25 21:58:32 +0000 |
commit | 24dfb05a8681591aaeaf852214c6c268bb40ed3e (patch) | |
tree | 6613c07d9944771f821d1a5e2ff3f4d6e0eb3f5d /src/modules/m_randquote.cpp | |
parent | 807af44602e002ef41087131a99fa400d1ca737f (diff) |
Mini security audit
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5333 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_randquote.cpp')
-rw-r--r-- | src/modules/m_randquote.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/modules/m_randquote.cpp b/src/modules/m_randquote.cpp index 46af34f63..b68eb5aa5 100644 --- a/src/modules/m_randquote.cpp +++ b/src/modules/m_randquote.cpp @@ -43,18 +43,16 @@ class cmd_randquote : public command_t { std::string str; int fsize; - char buf[MAXBUF]; + if (q_file == "" || quotes->Exists()) { fsize = quotes->FileSize(); str = quotes->GetLine(rand() % fsize); - sprintf(buf,"NOTICE %s :%s%s%s",user->nick,prefix.c_str(),str.c_str(),suffix.c_str()); - user->WriteServ(std::string(buf)); + user->WriteServ("NOTICE %s :%s%s%s",user->nick,prefix.c_str(),str.c_str(),suffix.c_str()); } else { - sprintf(buf, "NOTICE %s :Your administrator specified an invalid quotes file, please bug them about this.", user->nick); - user->WriteServ(std::string(buf)); + user->WriteServ("NOTICE %s :Your administrator specified an invalid quotes file, please bug them about this.", user->nick); return CMD_FAILURE; } return CMD_SUCCESS; |