mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 12:52:46 +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;
|
||||
int i;
|
||||
|
||||
s = strchr(string, ':') + 1;
|
||||
if (!cl_freply->value)
|
||||
return;
|
||||
|
||||
s = strchr(string, ':');
|
||||
if (!(s = strchr(string, ':')))
|
||||
return;
|
||||
s++;
|
||||
while (isspace(*s))
|
||||
s++;
|
||||
|
||||
if (s && cl_freply->value) {
|
||||
for (i = 0; f_replies[i].name; i++) {
|
||||
if (!strncmp(f_replies[i].name, s, strlen(f_replies[i].name)) && cl_freply->value) {
|
||||
while (*s && !isspace(*s))
|
||||
s++;
|
||||
Cbuf_AddText(f_replies[i].func(s));
|
||||
f_replies[i].lasttime = realtime;
|
||||
}
|
||||
for (i = 0; f_replies[i].name; i++) {
|
||||
if (!strncmp(f_replies[i].name, s, strlen(f_replies[i].name)) && cl_freply->value) {
|
||||
while (*s && !isspace(*s))
|
||||
s++;
|
||||
Cbuf_AddText(f_replies[i].func(s));
|
||||
f_replies[i].lasttime = realtime;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue