small fix

This commit is contained in:
Anselm R. Garbe 2007-02-08 15:10:10 +01:00
parent ea71b6e88e
commit 1f1228547c

7
sic.c
View File

@ -105,15 +105,14 @@ parsesrv(char *msg) {
if(!(p = strchr(msg, ' '))) if(!(p = strchr(msg, ' ')))
return; return;
*p = 0; *p = 0;
for(++p; *p == ' '; p++);
cmd = p;
usr = &msg[1]; usr = &msg[1];
if((p = strchr(msg, '!'))) cmd = ++p;
if((p = strchr(usr, '!')))
*p = 0; *p = 0;
} else } else
cmd = msg; cmd = msg;
/* remove CRLFs */ /* remove CRLFs */
for(p = cmd; p && *p != 0; p++) for(p = cmd; *p; p++)
if(*p == '\r' || *p == '\n') if(*p == '\r' || *p == '\n')
*p = 0; *p = 0;
if(!strncmp("PONG", cmd, 4)) if(!strncmp("PONG", cmd, 4))