mirror of
https://git.code.sf.net/p/quake/newtree
synced 2024-11-12 23:54:33 +00:00
fix a seg due to not-yet-initialized sv_highchars cvar
This commit is contained in:
parent
1afaefd9dc
commit
1e1ee75773
1 changed files with 4 additions and 3 deletions
|
@ -47,10 +47,11 @@ void SV_SendServerInfoChange (char *key, char *value);
|
||||||
void
|
void
|
||||||
Cvar_Info (cvar_t *var)
|
Cvar_Info (cvar_t *var)
|
||||||
{
|
{
|
||||||
|
int highchars = sv_highchars ? sv_highchars->int_val : 0;
|
||||||
if (var->flags & CVAR_SERVERINFO) {
|
if (var->flags & CVAR_SERVERINFO) {
|
||||||
unsigned char info[1024], *p, *c;
|
unsigned char info[1024], *p, *c;
|
||||||
|
|
||||||
if (!sv_highchars || !sv_highchars->int_val) {
|
if (!highchars) {
|
||||||
for (p = info, c = var->string;
|
for (p = info, c = var->string;
|
||||||
*c && (p - info < sizeof (info) - 1);) {
|
*c && (p - info < sizeof (info) - 1);) {
|
||||||
*c &= 0x7f;
|
*c &= 0x7f;
|
||||||
|
@ -60,10 +61,10 @@ Cvar_Info (cvar_t *var)
|
||||||
}
|
}
|
||||||
*p = 0;
|
*p = 0;
|
||||||
Info_SetValueForKey (svs.info, var->name, info,
|
Info_SetValueForKey (svs.info, var->name, info,
|
||||||
MAX_SERVERINFO_STRING, !sv_highchars->int_val);
|
MAX_SERVERINFO_STRING, !highchars);
|
||||||
} else
|
} else
|
||||||
Info_SetValueForKey (svs.info, var->name, var->string,
|
Info_SetValueForKey (svs.info, var->name, var->string,
|
||||||
MAX_SERVERINFO_STRING, !sv_highchars->int_val);
|
MAX_SERVERINFO_STRING, !highchars);
|
||||||
|
|
||||||
SV_SendServerInfoChange (var->name, var->string);
|
SV_SendServerInfoChange (var->name, var->string);
|
||||||
// SV_BroadcastCommand ("fullserverinfo \"%s\"\n", svs.info);
|
// SV_BroadcastCommand ("fullserverinfo \"%s\"\n", svs.info);
|
||||||
|
|
Loading…
Reference in a new issue