sic

simple irc client
git clone git://git.suckless.org/sic
Log | Files | Refs | README | LICENSE

commit 264f8e9422850a8e7a5bda01d1ca04e17f553164
parent fe1e3560bedafa1d923bf34abb8f72aef2acb75f
Author: Anselm R. Garbe <arg@suckless.org>
Date:   Fri,  9 Feb 2007 15:02:56 +0100

changed output
Diffstat:
sic.c | 16++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/sic.c b/sic.c @@ -47,8 +47,8 @@ pout(char *channel, char *msg) { static char timestr[18]; time_t t = time(0); - strftime(timestr, sizeof timestr, "%F %R", localtime(&t)); - fprintf(stdout, "%-8.8s: %s %s\n", channel, timestr, msg); + strftime(timestr, sizeof timestr, "%D %R", localtime(&t)); + fprintf(stdout, "%-12.12s: %s %s\n", channel, timestr, msg); } static void @@ -99,6 +99,7 @@ static void parsesrv(char *msg) { char *chan, *cmd, *p, *txt, *usr; + txt = NULL; if(!msg || !(*msg)) return; pout("debug", msg); @@ -111,14 +112,13 @@ parsesrv(char *msg) { cmd = ++p; if((p = strchr(usr, '!'))) *p = 0; - /* remove CRLFs */ - if(!(p = strchr(cmd, ':'))) - return; - *p = 0; - txt = ++p; - for(p = txt; *p; p++) + for(p = cmd; *p; p++) /* remove CRLFs */ if(*p == '\r' || *p == '\n') *p = 0; + if((p = strchr(cmd, ':'))) { + *p = 0; + txt = ++p; + } if(!strncmp("PONG", cmd, 4)) return; if(!strncmp("PRIVMSG", cmd, 7) && txt) {