aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKian Kasad <kian@kasad.com>2021-02-10 03:58:30 -0800
committerGitHub <noreply@github.com>2021-02-10 06:58:30 -0500
commit02bbbe8389b41c4cde0d0167b413df12da85130f (patch)
treef8161615359d3ebbd4d2d757270d6d223ef99a93
parent0.2.3 (diff)
downloadkirc-02bbbe8389b41c4cde0d0167b413df12da85130f.tar.gz
kirc-02bbbe8389b41c4cde0d0167b413df12da85130f.tar.bz2
kirc-02bbbe8389b41c4cde0d0167b413df12da85130f.tar.xz
kirc-02bbbe8389b41c4cde0d0167b413df12da85130f.tar.zst
kirc-02bbbe8389b41c4cde0d0167b413df12da85130f.zip
fix printing of join/part messages when cdef is a substring of the actual channel name (#99)
-rw-r--r--kirc.c4
1 files 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);
}