From 08100f69ea00cca74f6aca97e9eefb5d554a55e9 Mon Sep 17 00:00:00 2001 From: Kian Kasad Date: Tue, 9 Feb 2021 21:38:12 -0800 Subject: [PATCH] fix printing of join/part messages when cdef is a substring of the actual channel name --- kirc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); }