aboutsummaryrefslogtreecommitdiffstats
path: root/otr.c
diff options
context:
space:
mode:
authordequis <dx@dxzone.com.ar>2015-11-27 20:42:00 -0300
committerdequis <dx@dxzone.com.ar>2015-11-27 20:42:00 -0300
commit47ab9a9c9411f14bb95da9bfb97a943e1c531c48 (patch)
tree3f87a8e20d4dfea898d0db4683a89d42d42fc867 /otr.c
parentd088ee8bc50cfe13130da745791f533705acd35e (diff)
misc.c: Add a str_reject_chars function, use it in otr_filter_colors
Diffstat (limited to 'otr.c')
-rw-r--r--otr.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/otr.c b/otr.c
index 201aa816..4888691a 100644
--- a/otr.c
+++ b/otr.c
@@ -750,14 +750,9 @@ void op_create_instag(void *opdata, const char *account, const char *protocol)
}
}
-static char *otr_filter_colors(char *msg) {
- int i;
- for (i = 0; msg[i]; i++) {
- if (msg[i] == '\x02' || msg[i] == '\x03') {
- msg[i] = '?';
- }
- }
- return msg;
+static char *otr_filter_colors(char *msg)
+{
+ return str_reject_chars(msg, "\x02\x03", '?');
}
/* returns newly allocated string */