From 02bbbe8389b41c4cde0d0167b413df12da85130f Mon Sep 17 00:00:00 2001 From: Kian Kasad Date: Wed, 10 Feb 2021 03:58:30 -0800 Subject: fix printing of join/part messages when cdef is a substring of the actual channel name (#99) --- kirc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'kirc.c') diff --git a/kirc.c b/kirc.c index a5e9d5d..ff17f95 100644 --- a/kirc.c +++ b/kirc.c @@ -485,7 +485,7 @@ static void paramPrintNick(struct Param * p) { static void paramPrintPart(struct Param * p) { printf("%*s<-- \x1b[34;1m%s\x1b[0m", p->nicklen - 3, "", p->nickname); - if (p->channel != NULL && strstr(p->channel, cdef) == NULL) + if (p->channel != NULL && strcmp(p->channel+1, cdef)) printf(" [\x1b[33m%s\x1b[0m] ", p->channel); } @@ -495,7 +495,7 @@ static void paramPrintQuit(struct Param * p) { static void paramPrintJoin(struct Param * p) { printf("%*s--> \x1b[32;1m%s\x1b[0m", p->nicklen - 3, "", p->nickname); - if (p->channel != NULL && strstr(p->channel, cdef) == NULL) + if (p->channel != NULL && strcmp(p->channel+1, cdef)) printf(" [\x1b[33m%s\x1b[0m] ", p->channel); } -- cgit v1.2.3