Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

m_xline_db Fix pointless excessive stack usage in ReadDatabase()

  • Loading branch information...
commit 31344bbedf40756d2476062c8426413872d7d4de 1 parent e55cafb
Attila Molnar attilamolnar authored
Showing with 2 additions and 5 deletions.
  1. +2 −5 src/modules/m_xline_db.cpp
7 src/modules/m_xline_db.cpp
View
@@ -169,7 +169,6 @@ class ModuleXLineDB : public Module
{
FILE *f;
char linebuf[MAXBUF];
- unsigned int lineno = 0;
f = fopen(xlinedbpath.c_str(), "r");
if (!f)
@@ -201,16 +200,14 @@ class ModuleXLineDB : public Module
c++;
}
- // Smart man might think of initing to 1, and moving this to the bottom. Don't. We use continue in this loop.
- lineno++;
// Inspired by the command parser. :)
irc::tokenstream tokens(linebuf);
int items = 0;
- std::string command_p[MAXPARAMETERS];
+ std::string command_p[7];
std::string tmp;
- while (tokens.GetToken(tmp) && (items < MAXPARAMETERS))
+ while (tokens.GetToken(tmp) && (items < 7))
{
command_p[items] = tmp;
items++;
Please sign in to comment.
Something went wrong with that request. Please try again.