diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/modules/m_stripcolor.cpp | 15 |
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(); + } } } } |