From 57ad90c3c0cf8d61ed1ea1bc7b624ed55ecc906b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Wed, 13 Oct 2021 18:42:47 +0200 Subject: [PATCH] irc: do not display message with "(null)" for numeric command received if pos_args is NULL --- src/plugins/irc/irc-protocol.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index 55ce92c36..eac97057e 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -3089,13 +3089,16 @@ IRC_PROTOCOL_CALLBACK(numeric) pos_args = (argv_eol[2][0] == ':') ? argv_eol[2] + 1 : argv_eol[2]; } - weechat_printf_date_tags ( - irc_msgbuffer_get_target_buffer (server, NULL, command, NULL, NULL), - date, - irc_protocol_tags (command, "irc_numeric", NULL, NULL), - "%s%s", - weechat_prefix ("network"), - pos_args); + if (pos_args) + { + weechat_printf_date_tags ( + irc_msgbuffer_get_target_buffer (server, NULL, command, NULL, NULL), + date, + irc_protocol_tags (command, "irc_numeric", NULL, NULL), + "%s%s", + weechat_prefix ("network"), + pos_args); + } return WEECHAT_RC_OK; }