From 75bd647d1591de1fb6fd51c0cbea28b09e03a037 Mon Sep 17 00:00:00 2001 From: Kevin Easton Date: Sun, 30 Aug 2015 22:03:38 +1000 Subject: [PATCH] Switch stripansi() to stripansicodes() in the CTCP reply parser. stripansi() actually just munged control-characters, so it just turned ANSI codes into visible junk. stripansicodes() instead leaves control characters alone but removes complete ANSI sequences from the string. I'm not sure if even that is necessary, really - after all, we always allowed ^B, ^C etc style formatting in CTCP replies. --- source/ctcp.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/source/ctcp.c b/source/ctcp.c index b3e1f7c..7659db4 100644 --- a/source/ctcp.c +++ b/source/ctcp.c @@ -1323,7 +1323,6 @@ extern char *do_notice_ctcp (char *from, char *to, char *str) *ctcp_argument; int i; char *ptr; - char *tbuf = NULL; int allow_ctcp_reply = 1; #ifdef WANT_DLL @@ -1341,9 +1340,7 @@ extern char *do_notice_ctcp (char *from, char *to, char *str) if (!in_ctcp_flag) in_ctcp_flag = -1; - tbuf = stripansi(str); - strlcpy(local_ctcp_buffer, tbuf, sizeof local_ctcp_buffer - 2); - new_free(&tbuf); + strlcpy(local_ctcp_buffer, stripansicodes(str), sizeof local_ctcp_buffer - 2); for (;;strlcat(local_ctcp_buffer, last, sizeof local_ctcp_buffer - 2)) {