use strlen
This commit is contained in:
1 parent
661d4ee8e1
commit
1ed3cf28b0
1 file changed
+2
-7
@@ -480,13 +480,10 @@ static int lib_cvRegisterVar(lua_State *L)
|
||||
|
||||
if (!(((cvar->flags & CV_HIDEN)) || (cvar->flags & CV_NOSHOWHELP)) && (cvar->PossibleValue || !(cvar->value == 0 && stricmp(cvar->string, "0"))))
|
||||
{
|
||||
char *temp = NULL;
|
||||
|
||||
if (!category)
|
||||
{
|
||||
temp = strdup(wadfiles[numwadfiles - 1]->filename);
|
||||
nameonly(temp);
|
||||
|
||||
char *temp = wadfiles[numwadfiles - 1]->filename;
|
||||
temp += strlen(temp) - nameonlylength(temp);
|
||||
category = temp;
|
||||
}
|
||||
|
||||
@@ -494,8 +491,6 @@ static int lib_cvRegisterVar(lua_State *L)
|
||||
M_SlotCvarIntoModMenu(cvar, category, menu_name);
|
||||
else
|
||||
M_SlotCvarIntoModMenu(cvar, category, cvar->name);
|
||||
|
||||
free (temp);
|
||||
}
|
||||
|
||||
// return cvar userdata
|
||||
|
||||
Reference in new issue
Block a user