]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cvar.c
cvar: Don't memset cvar->aliases before it's even allocated
[xonotic/darkplaces.git] / cvar.c
diff --git a/cvar.c b/cvar.c
index ce1e065254ac1bba166c1b34b7fc201813e7ef1d..58562d6b642742e911d879ddc0fdc55dd50af0c4 100644 (file)
--- a/cvar.c
+++ b/cvar.c
@@ -647,7 +647,7 @@ void Cvar_RegisterVariable (cvar_t *variable)
        }
 
        // check for overlap with a command
-       if (Cmd_Exists(cmd_local, variable->name) || Cmd_Exists(cmd_local, variable->name))
+       if (Cmd_Exists(cmd_local, variable->name))
        {
                Con_Printf("Cvar_RegisterVariable: %s is a command\n", variable->name);
                return;
@@ -712,7 +712,7 @@ cvar_t *Cvar_Get(cvar_state_t *cvars, const char *name, const char *value, int f
        }
 
        // check for overlap with a command
-       if (Cmd_Exists(cmd_local, name) || Cmd_Exists(cmd_local, name))
+       if (Cmd_Exists(cmd_local, name))
        {
                Con_Printf("Cvar_Get: %s is a command\n", name);
                return NULL;
@@ -731,7 +731,6 @@ cvar_t *Cvar_Get(cvar_state_t *cvars, const char *name, const char *value, int f
        cvar->aliases = NULL;
        cvar->aliases_size = 0;
        cvar->initstate = NULL;
-       memset(cvar->aliases, 0, sizeof(char *));
 
        if(newdescription && *newdescription)
                cvar->description = (char *)Mem_strdup(zonemempool, newdescription);