[hackers] sic: new tip (= 72)

From: Anselm R. Garbe <arg_AT_suckless.org>
Date: Thu, 08 Feb 2007 15:20:02 +0100

changeset: 72:a03eed56cd6e
tag: tip
user: Anselm R. Garbe <arg_AT_suckless.org>
date: Thu Feb 08 15:10:47 2007 +0100
files: sic.c
description:
fixed part message

changeset: 71:b1a9e456c5b9
user: Anselm R. Garbe <arg_AT_suckless.org>
date: Thu Feb 08 15:10:10 2007 +0100
files: sic.c
description:
small fix

diff -r c92ffabc64b1 -r a03eed56cd6e sic.c
--- a/sic.c Thu Feb 08 15:03:42 2007 +0100
+++ b/sic.c Thu Feb 08 15:10:47 2007 +0100
@@ -74,7 +74,7 @@ parsein(char *msg) {
         if(!strncmp(msg + 1, "j ", 2) && (msg[3] == '#'))
                 snprintf(bufout, sizeof bufout, "JOIN %s\r\n", &msg[3]);
         else if(!strncmp(msg + 1, "l ", 2))
- snprintf(bufout, sizeof bufout, "PART %s :sic - 300 LOC are too much!\r\n", &msg[3]);
+ snprintf(bufout, sizeof bufout, "PART %s :sic - 250 LOC are too much!\r\n", &msg[3]);
         else if(!strncmp(msg + 1, "m ", 2)) {
                 if((p = strchr(&msg[3], ' ')))
                         *(p++) = 0;
@@ -105,15 +105,14 @@ parsesrv(char *msg) {
                 if(!(p = strchr(msg, ' ')))
                         return;
                 *p = 0;
- for(++p; *p == ' '; p++);
- cmd = p;
                 usr = &msg[1];
- if((p = strchr(msg, '!')))
+ cmd = ++p;
+ if((p = strchr(usr, '!')))
                         *p = 0;
         } else
                 cmd = msg;
         /* remove CRLFs */
- for(p = cmd; p && *p != 0; p++)
+ for(p = cmd; *p; p++)
                 if(*p == '\r' || *p == '\n')
                         *p = 0;
         if(!strncmp("PONG", cmd, 4))
Received on Thu Feb 08 2007 - 15:20:02 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:55:00 UTC