fix a seg due to not-yet-initialized sv_highchars cvar

This commit is contained in:
Bill Currie 2001-10-20 21:31:21 +00:00
parent 1afaefd9dc
commit 1e1ee75773

View file

@ -47,10 +47,11 @@ void SV_SendServerInfoChange (char *key, char *value);
void
Cvar_Info (cvar_t *var)
{
int highchars = sv_highchars ? sv_highchars->int_val : 0;
if (var->flags & CVAR_SERVERINFO) {
unsigned char info[1024], *p, *c;
if (!sv_highchars || !sv_highchars->int_val) {
if (!highchars) {
for (p = info, c = var->string;
*c && (p - info < sizeof (info) - 1);) {
*c &= 0x7f;
@ -60,10 +61,10 @@ Cvar_Info (cvar_t *var)
}
*p = 0;
Info_SetValueForKey (svs.info, var->name, info,
MAX_SERVERINFO_STRING, !sv_highchars->int_val);
MAX_SERVERINFO_STRING, !highchars);
} else
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_BroadcastCommand ("fullserverinfo \"%s\"\n", svs.info);