aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2015-06-06 23:56:43 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2015-06-06 23:56:43 +0200
commit7c2fe522baefe170ed4be78e6c6dbda8946247a1 (patch)
treed70c28f8c912c3cc17332a907df39cc0ed4b6b7c
parent671536bfcae6cc0378972d8c2ea96c8681e093c1 (diff)
downloadxK-7c2fe522baefe170ed4be78e6c6dbda8946247a1.tar.gz
xK-7c2fe522baefe170ed4be78e6c6dbda8946247a1.tar.xz
xK-7c2fe522baefe170ed4be78e6c6dbda8946247a1.zip
degesch: fix logging empty QUIT/PART reasons
-rw-r--r--degesch.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/degesch.c b/degesch.c
index 26d7fcf..4dd4779 100644
--- a/degesch.c
+++ b/degesch.c
@@ -3009,6 +3009,8 @@ error_ssl_1:
static char *
irc_to_utf8 (struct app_context *ctx, const char *text)
{
+ if (!text)
+ return NULL;
size_t len = strlen (text) + 1;
if (utf8_validate (text, len))
return xstrdup (text);
@@ -4309,7 +4311,7 @@ irc_handle_part (struct server *s, const struct irc_message *msg)
if (!irc_is_channel (s, channel_name))
return;
- const char *message = "";
+ const char *message = NULL;
if (msg->params.len > 1)
message = msg->params.vector[1];
@@ -4489,7 +4491,7 @@ irc_handle_quit (struct server *s, const struct irc_message *msg)
if (!user)
return;
- const char *message = "";
+ const char *message = NULL;
if (msg->params.len > 0)
message = msg->params.vector[0];