fix a seg when the chat message doesn't have : in it

This commit is contained in:
Bill Currie 2001-11-12 03:32:04 +00:00
parent 150128f158
commit 6beb96100a

View file

@ -454,18 +454,22 @@ Team_ParseChat (const char *string)
char *s; char *s;
int i; int i;
s = strchr(string, ':') + 1; if (!cl_freply->value)
return;
s = strchr(string, ':');
if (!(s = strchr(string, ':')))
return;
s++;
while (isspace(*s)) while (isspace(*s))
s++; s++;
if (s && cl_freply->value) { for (i = 0; f_replies[i].name; i++) {
for (i = 0; f_replies[i].name; i++) { if (!strncmp(f_replies[i].name, s, strlen(f_replies[i].name)) && cl_freply->value) {
if (!strncmp(f_replies[i].name, s, strlen(f_replies[i].name)) && cl_freply->value) { while (*s && !isspace(*s))
while (*s && !isspace(*s)) s++;
s++; Cbuf_AddText(f_replies[i].func(s));
Cbuf_AddText(f_replies[i].func(s)); f_replies[i].lasttime = realtime;
f_replies[i].lasttime = realtime;
}
} }
} }
} }