ii

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

commit da96e34948197fd3cc6d299397278c7acb1279fe
parent c1ea031434c56126d1b0ba139f605c55d14ddf2f
Author: nion@noname <unknown>
Date:   Sun, 29 Jan 2006 20:50:20 +0100

fix incomplete buffer initialization

Diffstat:
Mii.c | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

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