G_DoPlayDemo: fix demoname becoming garbage when replay restarts/rewinds

only used in the error paths, which we shouldnt reach
but im not a fan of having a chance of putting garbo in the console
This commit is contained in:
alufolie91 committed 2026-03-25 19:28:29 +01:00
1 parent fbc46f0b23
commit 43d2ad7b78
1 file changed
+2 -2
+2 -2
View File
@@ -2616,7 +2616,7 @@ void G_DoPlayDemo(char *defdemoname)
if (defdemoname == NULL)
{
demobuf.p = demobuf.buffer;
pdemoname = ZZ_Alloc(1); // Easier than adding checks for this everywhere it's freed
pdemoname = ZZ_Calloc(1); // Easier than adding checks for this everywhere it's freed
}
else
{
@@ -2628,7 +2628,7 @@ void G_DoPlayDemo(char *defdemoname)
n++;
pdemoname = ZZ_Alloc(strlen(n)+1);
strcpy(pdemoname,n);
strcpy(pdemoname, n);
M_SetPlaybackMenuPointer();