From e3f6b54d8b2d50d9b1c172443dae0c906dd26a6a Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C4=81nis=20R=C5=ABcis?= Date: Tue, 30 Mar 2010 23:18:34 +0300 Subject: [PATCH] IRC: factor out message printing --- irc.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/irc.c b/irc.c index d8890793..37f9f0cb 100644 --- a/irc.c +++ b/irc.c @@ -239,20 +239,24 @@ static ircmessage_t *IRC_ParseMessage(const char *line) return msg; } +static void IRC_DumpMessage(const ircmessage_t *msg) +{ + int i; + + Con_Printf("[IRC] prefix : %s\n", msg->prefix ? msg->prefix : ""); + Con_Printf("[IRC] command: %s\n", msg->command); + + for (i = 0; i < msg->args_num; i++) + Con_Printf("[IRC] arg %-3d: %s\n", i, msg->args[i]); +} + static void IRC_ProcessMessage(const char *line) { ircmessage_t *msg; if ((msg = IRC_ParseMessage(line))) { - int i; - - Con_Printf("[IRC] prefix : %s\n", msg->prefix ? msg->prefix : ""); - Con_Printf("[IRC] command: %s\n", msg->command); - - for (i = 0; i < msg->args_num; i++) - Con_Printf("[IRC] arg %-3d: %s\n", i, msg->args[i]); - + IRC_DumpMessage(msg); IRC_FreeMessage(msg); } } -- 2.39.2