Nico Golde:

small fix by Adrien Krunch Kunysz
This commit is contained in:
nion@localhost 2007-01-16 15:30:30 +01:00
parent cf1f7a56b4
commit eee0f4e6b8

7
ii.c
View File

@ -245,9 +245,8 @@ static void proc_channels_input(Channel *c, char *buf)
} }
switch (buf[1]) { switch (buf[1]) {
case 'j': case 'j':
p = strchr(&buf[3], ' '); if(!(p = strchr(&buf[3], ' '))) return;
if(p) *p = 0;
*p = 0;
if((buf[3]=='#')||(buf[3]=='&')||(buf[3]=='+')||(buf[3]=='!')){ if((buf[3]=='#')||(buf[3]=='&')||(buf[3]=='+')||(buf[3]=='!')){
snprintf(message, PIPE_BUF, "JOIN %s\r\n", &buf[3]); snprintf(message, PIPE_BUF, "JOIN %s\r\n", &buf[3]);
add_channel(&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, ' '); 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; return;
} else if(!strncmp("PING", argv[TOK_CMD], 5)) { } else if(!strncmp("PING", argv[TOK_CMD], 5)) {
snprintf(message, PIPE_BUF, "PONG %s\r\n", argv[TOK_TEXT]); snprintf(message, PIPE_BUF, "PONG %s\r\n", argv[TOK_TEXT]);