ii

irc it, simple FIFO based irc client
git clone git://git.suckless.org/ii
Log | Files | Refs | README | LICENSE

commit eee0f4e6b8f910424c8b006d2e65532644d3108e
parent cf1f7a56b404e56d122002fbfc1c26cf62b44771
Author: nion@localhost <unknown>
Date:   Tue, 16 Jan 2007 15:30:30 +0100

Nico Golde:
small fix by Adrien Krunch Kunysz
Diffstat:
Mii.c | 7+++----
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git 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]);