commit 6a14787a8a25bf37aacecbd7c42e69ed35e7ad09
Author: Fabian Greffrath <fabian@greffrath.com>
AuthorDate: Wed Oct 28 15:36:30 2020 +0100
Commit: GitHub <noreply@github.com>
CommitDate: Wed Oct 28 15:36:30 2020 +0100
heretic: allow for arbitrarily long demo file names (#1328)
---
src/heretic/g_game.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/heretic/g_game.c b/src/heretic/g_game.c
index 56de0b8a..2e0c44f5 100644
--- a/src/heretic/g_game.c
+++ b/src/heretic/g_game.c
@@ -109,7 +109,7 @@ int totalkills, totalitems, totalsecret; // for intermission
int mouseSensitivity;
-char demoname[32];
+char *demoname;
boolean demorecording;
boolean longtics; // specify high resolution turning in demos
boolean lowres_turn;
@@ -1858,6 +1858,7 @@ void G_WriteDemoTiccmd(ticcmd_t * cmd)
void G_RecordDemo(skill_t skill, int numplayers, int episode, int map,
const char *name)
{
+ size_t demoname_size;
int i;
int maxsize;
@@ -1884,8 +1885,9 @@ void G_RecordDemo(skill_t skill, int numplayers, int episode, int map,
G_InitNew(skill, episode, map);
usergame = false;
- M_StringCopy(demoname, name, sizeof(demoname));
- M_StringConcat(demoname, ".lmp", sizeof(demoname));
+ demoname_size = strlen(name) + 5;
+ demoname = Z_Malloc(demoname_size, PU_STATIC, NULL);
+ M_snprintf(demoname, demoname_size, "%s.lmp", name);
maxsize = 0x20000;
//!