From da96e34948197fd3cc6d299397278c7acb1279fe Mon Sep 17 00:00:00 2001 From: "nion@noname" Date: Sun, 29 Jan 2006 20:50:20 +0100 Subject: [PATCH] fix incomplete buffer initialization --- ii.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ii.c b/ii.c index 67e260f..5cac11a 100644 --- a/ii.c +++ b/ii.c @@ -228,7 +228,6 @@ static void proc_channels_input(Channel *c, char *buf) { static char infile[256]; char *p; - if(buf[0] != '/' && buf[0] != 0) { proc_channels_privmsg(c->name, buf); return; @@ -262,7 +261,7 @@ static void proc_channels_input(Channel *c, char *buf) return; break; case 'n': - snprintf(nick, sizeof(nick),"%s", buf); + snprintf(nick, sizeof(nick),"%s", &buf[3]); snprintf(message, PIPE_BUF, "NICK %s\r\n", &buf[3]); break; case 'l': @@ -389,6 +388,7 @@ static int read_line(int fd, size_t res_len, char *buf) static void handle_channels_input(Channel *c) { static char buf[PIPE_BUF]; + memset(buf,0,sizeof(buf)); if(read_line(c->fd, PIPE_BUF, buf) == -1) { int fd = open_channel(c->name); if(fd != -1)