summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2013-11-13 01:36:30 +0100
committerFlorent Le Coz <louiz@louiz.org>2013-11-13 01:36:30 +0100
commitabce2fc92ec80e95066f6362492351b85ad8aef1 (patch)
tree0b292b9ef13d061a8b2eab6eb9305ee541598a1f /src
parent0859801230f999889d0f7356864888e8c5936cda (diff)
downloadbiboumi-abce2fc92ec80e95066f6362492351b85ad8aef1.tar.gz
biboumi-abce2fc92ec80e95066f6362492351b85ad8aef1.tar.bz2
biboumi-abce2fc92ec80e95066f6362492351b85ad8aef1.tar.xz
biboumi-abce2fc92ec80e95066f6362492351b85ad8aef1.zip
Do not crash on special chars in the content of message
That’s ugly, and we need to sanitize everything properly, and also handle these special messages.
Diffstat (limited to 'src')
-rw-r--r--src/bridge/colors.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/bridge/colors.cpp b/src/bridge/colors.cpp
index f49f31f..b34ab4a 100644
--- a/src/bridge/colors.cpp
+++ b/src/bridge/colors.cpp
@@ -11,7 +11,11 @@ void remove_irc_colors(std::string& str)
if (c == IRC_COLOR_BOLD_CHAR || c == IRC_COLOR_COLOR_CHAR ||
c == IRC_COLOR_FIXED_CHAR || c == IRC_COLOR_RESET_CHAR ||
c == IRC_COLOR_REVERSE_CHAR || c == IRC_COLOR_REVERSE2_CHAR ||
- c == IRC_COLOR_UNDERLINE_CHAR || c == IRC_COLOR_ITALIC_CHAR)
+ c == IRC_COLOR_UNDERLINE_CHAR || c == IRC_COLOR_ITALIC_CHAR ||
+ // HACK: until we properly handle things
+ // like ^AVERSION^A, remove the ^A chars
+ // here.
+ c == '\u0001')
return true;
return false;
}