diff options
author | Michael Czigler <37268479+mcpcpc@users.noreply.github.com> | 2020-10-17 08:47:14 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-17 08:47:14 -0400 |
commit | 5c6c123ec6bb75114d3db27f44038696692133f5 (patch) | |
tree | b9f03cafcc8b815078190fc9a757c90494987445 /kirc.c | |
parent | Delete CNAME (diff) | |
download | kirc-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 'kirc.c')
-rw-r--r-- | kirc.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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)) { |