use strlen

This commit is contained in:
Alug committed 2025-02-21 20:05:26 +01:00
1 parent 661d4ee8e1
commit 1ed3cf28b0
1 file changed
+2 -7
+2 -7
View File
@@ -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