Skip to content

Commit

Permalink
do not duplicate string
Browse files Browse the repository at this point in the history
  • Loading branch information
elf-alchemist committed Feb 10, 2025
1 parent 0ce23a1 commit 70c7ad6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/w_wad.c
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ int W_GetNumForName (const char* name) // killough -- const added
// [Nyan] Widescreen patches
const char *M_ApplyWidePatch(const char *lump_main)
{
char lump_wide[9] = "W_";
static char lump_wide[9] = "W_";
char lump_short[7];

memcpy(lump_short, lump_main, strnlen(lump_main, 7));
Expand All @@ -408,7 +408,7 @@ const char *M_ApplyWidePatch(const char *lump_main)

if (W_CheckNumForName(lump_wide) >= 0)
{
return M_StringDuplicate(lump_wide);
return lump_wide;
}

return lump_main;
Expand Down

0 comments on commit 70c7ad6

Please sign in to comment.