From 19aa5d081acc8e35fb6a49016ffebeb447f1d375 Mon Sep 17 00:00:00 2001 From: frostycoolslug Date: Fri, 1 Apr 2005 14:47:59 +0000 Subject: Fixed Crash bug cause by multiple declarations of 'Srv' (Bug #35) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@935 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_randquote.cpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'src/modules/m_randquote.cpp') diff --git a/src/modules/m_randquote.cpp b/src/modules/m_randquote.cpp index 197efcdb6..01a6e3270 100644 --- a/src/modules/m_randquote.cpp +++ b/src/modules/m_randquote.cpp @@ -34,26 +34,27 @@ std::string suffix; void handle_randquote(char** parameters, int pcntl, userrec *user) { - std::string str; - int fsize; - char buf[MAXBUF]; + std::string str; + int fsize; + char buf[MAXBUF]; - fsize = quotes->FileSize(); - srand(time(NULL)); - str = quotes->GetLine(rand() % fsize); + fsize = quotes->FileSize(); + srand(time(NULL)); + str = quotes->GetLine(rand() % fsize); - sprintf(buf,"NOTICE %s :%s%s%s",user->nick,prefix.c_str(),str.c_str(),suffix.c_str()); - Srv->SendServ(user->fd, buf); - return; + sprintf(buf,"NOTICE %s :%s%s%s",user->nick,prefix.c_str(),str.c_str(),suffix.c_str()); + Srv->SendServ(user->fd, buf); + return; } + + + class ModuleRandQuote : public Module { private: - Server *Srv; - ConfigReader *conf; - + ConfigReader *conf; public: ModuleRandQuote() { -- cgit v1.2.3