From eee0f4e6b8f910424c8b006d2e65532644d3108e Mon Sep 17 00:00:00 2001 From: "nion@localhost" Date: Tue, 16 Jan 2007 15:30:30 +0100 Subject: [PATCH] Nico Golde: small fix by Adrien Krunch Kunysz --- ii.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/ii.c b/ii.c index 615cced..99235ef 100644 --- a/ii.c +++ b/ii.c @@ -245,9 +245,8 @@ static void proc_channels_input(Channel *c, char *buf) } switch (buf[1]) { case 'j': - p = strchr(&buf[3], ' '); - if(p) - *p = 0; + if(!(p = strchr(&buf[3], ' '))) return; + *p = 0; if((buf[3]=='#')||(buf[3]=='&')||(buf[3]=='+')||(buf[3]=='!')){ snprintf(message, PIPE_BUF, "JOIN %s\r\n", &buf[3]); add_channel(&buf[3]); @@ -342,7 +341,7 @@ static void proc_server_cmd(char *buf) } tokenize(&argv[TOK_CMD], TOK_LAST - TOK_CMD, cmd, ' '); - if(!strncmp("PONG", argv[TOK_CMD], 5)) { + if(!argv[TOK_CMD] || !strncmp("PONG", argv[TOK_CMD], 5)) { return; } else if(!strncmp("PING", argv[TOK_CMD], 5)) { snprintf(message, PIPE_BUF, "PONG %s\r\n", argv[TOK_TEXT]);