diff options
author | dequis <dx@dxzone.com.ar> | 2015-11-27 20:42:00 -0300 |
---|---|---|
committer | dequis <dx@dxzone.com.ar> | 2015-11-27 20:42:00 -0300 |
commit | 47ab9a9c9411f14bb95da9bfb97a943e1c531c48 (patch) | |
tree | 3f87a8e20d4dfea898d0db4683a89d42d42fc867 /otr.c | |
parent | d088ee8bc50cfe13130da745791f533705acd35e (diff) |
misc.c: Add a str_reject_chars function, use it in otr_filter_colors
Diffstat (limited to 'otr.c')
-rw-r--r-- | otr.c | 11 |
1 files changed, 3 insertions, 8 deletions
@@ -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 */ |