mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 21:02:50 +00:00
fix a seg when the chat message doesn't have : in it
This commit is contained in:
parent
150128f158
commit
6beb96100a
1 changed files with 13 additions and 9 deletions
|
@ -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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue