aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Czigler <37268479+mcpcpc@users.noreply.github.com>2020-10-17 08:47:14 -0400
committerGitHub <noreply@github.com>2020-10-17 08:47:14 -0400
commit5c6c123ec6bb75114d3db27f44038696692133f5 (patch)
treeb9f03cafcc8b815078190fc9a757c90494987445
parentDelete CNAME (diff)
downloadkirc-5c6c123ec6bb75114d3db27f44038696692133f5.tar.gz
kirc-5c6c123ec6bb75114d3db27f44038696692133f5.tar.bz2
kirc-5c6c123ec6bb75114d3db27f44038696692133f5.tar.xz
kirc-5c6c123ec6bb75114d3db27f44038696692133f5.tar.zst
kirc-5c6c123ec6bb75114d3db27f44038696692133f5.zip
Check channel for NULL condition (#65)
* check channel for NULL condition * fix typo
Diffstat (limited to '')
-rw-r--r--kirc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kirc.c b/kirc.c
index 7fe67f3..b8772ae 100644
--- a/kirc.c
+++ b/kirc.c
@@ -510,12 +510,12 @@ static void rawParser(char *string) {
printf("%*s<<< \x1b[34;1m%s\x1b[0m", g - 3, "", nickname);
} else if (!strncmp(command, "PART", 4)) {
printf("%*s<-- \x1b[34;1m%s\x1b[0m", g - 3, "", nickname);
- if (strstr(channel, chan_default) == NULL) {
+ if (channel != NULL && strstr(channel, chan_default) == NULL) {
printf(" [\x1b[33m%s\x1b[0m] ", channel);
}
} else if (!strncmp(command, "JOIN", 4)) {
printf("%*s--> \x1b[32;1m%s\x1b[0m", g - 3, "", nickname);
- if (strstr(channel, chan_default) == NULL) {
+ if (channel != NULL && strstr(channel, chan_default) == NULL) {
printf(" [\x1b[33m%s\x1b[0m] ", channel);
}
} else if (!strncmp(command, "NICK", 4)) {