Thanks to @StevenVanAcker for reporting and testing this
while (i < text.length() - 1 && isalpha(text[i + 1]))
++i;
while (i < text.length() - 1 && isalpha(text[i + 1]))
++i;
- std::string key(start, (i - start) + 1);
+ std::string key(text, start, (i - start) + 1);
result.append(replacements[key]);
}
else
result.append(replacements[key]);
}
else
if (text.length() > ServerInstance->Config->Limits.MaxLine - 2)
{
// this should happen rarely or never. Crop the string at 512 and try again.
if (text.length() > ServerInstance->Config->Limits.MaxLine - 2)
{
// this should happen rarely or never. Crop the string at 512 and try again.
- std::string try_again(0, ServerInstance->Config->Limits.MaxLine - 2);
+ std::string try_again(text, 0, ServerInstance->Config->Limits.MaxLine - 2);
Write(try_again);
return;
}
Write(try_again);
return;
}