summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
4c6fb80)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3418
e03df62e-2008-0410-955e-
edbf42e46eb7
void Split(std::string line, bool stripcolon, std::deque<std::string> &n)
{
void Split(std::string line, bool stripcolon, std::deque<std::string> &n)
{
+ // we don't do anything with a line > 2048
+ if (line.length() > 2048)
+ return;
if (!strchr(line.c_str(),' '))
{
n.push_back(line);
return;
}
std::stringstream s(line);
if (!strchr(line.c_str(),' '))
{
n.push_back(line);
return;
}
std::stringstream s(line);
- std::string param = "";
+ int count = 0;
+ char param[1024];
+ char* pptr = param;
if (c == ' ')
{
n.push_back(param);
if (c == ' ')
{
n.push_back(param);
item++;
}
else
{
if (!s.eof())
{
item++;
}
else
{
if (!s.eof())
{
+ *pptr++ = c;
+ count++;
- if ((param == ":") && (item > 0))
+ if ((*param == ':') && (count == 1) && (item > 0))
while (!s.eof())
{
s.get(c);
if (!s.eof())
{
while (!s.eof())
{
s.get(c);
if (!s.eof())
{
+ *pptr++ = c;
+ count++;