summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-04-12 14:21:15 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2008-04-12 14:21:15 +0000
commit4e9654e2e9d634a1123890b1910e3aa916e1d33d (patch)
tree9d8d61fb02c48529436d95d1123932a5d8833a65 /src
parent2205c65c72f3980be734e0616eb61b7eceb21b8f (diff)
Fix crash in m_stripcolor on windows when the colour code is the first item on a line
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9465 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_stripcolor.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/modules/m_stripcolor.cpp b/src/modules/m_stripcolor.cpp
index 39ba84b9a..9b3f8c2f1 100644
--- a/src/modules/m_stripcolor.cpp
+++ b/src/modules/m_stripcolor.cpp
@@ -129,10 +129,17 @@ class ModuleStripColor : public Module
if (seq || ((*i == 2) || (*i == 15) || (*i == 22) || (*i == 21) || (*i == 31)))
{
- safei = i;
- --i;
- sentence.erase(safei);
- }
+ if (i != sentence.begin())
+ {
+ safei = i;
+ --i;
+ sentence.erase(safei);
+ }
+ else
+ {
+ sentence.erase(i);
+ i = sentence.begin();
+ } }
}
}