Skip to content
This repository has been archived by the owner on Jun 23, 2023. It is now read-only.

Fix string overflow with large map numbers. #569

Merged
merged 2 commits into from
Feb 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions prboom2/src/p_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -2641,13 +2641,13 @@ void P_SetupLevel(int episode, int map, int playermask, skill_t skill)
// find map name
if (gamemode == commercial)
{
sprintf(lumpname, "map%02d", map); // killough 1/24/98: simplify
sprintf(gl_lumpname, "gl_map%02d", map); // figgi
snprintf(lumpname, sizeof(lumpname), "map%02d", map); // killough 1/24/98: simplify
snprintf(gl_lumpname, sizeof(gl_lumpname), "gl_map%02d", map); // figgi
}
else
{
sprintf(lumpname, "E%dM%d", episode, map); // killough 1/24/98: simplify
sprintf(gl_lumpname, "GL_E%iM%i", episode, map); // figgi
snprintf(lumpname, sizeof(lumpname), "E%dM%d", episode, map); // killough 1/24/98: simplify
snprintf(gl_lumpname, sizeof(gl_lumpname), "GL_E%iM%i", episode, map); // figgi
}

lumpnum = W_GetNumForName(lumpname);
Expand Down