mirror of
https://github.com/ZDoom/Raze.git
synced 2024-11-15 08:51:24 +00:00
SW: Fix a few memory access errors related to demo support
From-SVN: r8797
This commit is contained in:
parent
6d537f6d75
commit
00daf6295e
2 changed files with 9 additions and 2 deletions
|
@ -363,6 +363,9 @@ DemoTerm(void)
|
|||
|
||||
if (DemoSyncTest||DemoSyncRecord)
|
||||
{
|
||||
if (DemoSyncFile == NULL)
|
||||
return;
|
||||
|
||||
fclose(DemoSyncFile);
|
||||
DemoSyncFile = NULL;
|
||||
}
|
||||
|
|
|
@ -606,11 +606,13 @@ void LoadDemoRun(void)
|
|||
if (fin)
|
||||
{
|
||||
memset(DemoName,'\0',sizeof(DemoName));
|
||||
for (i = 0; TRUE; i++)
|
||||
for (i = 0; i < ARRAY_SSIZE(DemoName); i++)
|
||||
{
|
||||
if (fscanf(fin, "%s", DemoName[i]) == EOF)
|
||||
break;
|
||||
}
|
||||
if (i == ARRAY_SSIZE(DemoName))
|
||||
initputs("WARNING: demos.run is too long, ignoring remaining files\n");
|
||||
|
||||
fclose(fin);
|
||||
}
|
||||
|
@ -621,11 +623,13 @@ void LoadDemoRun(void)
|
|||
{
|
||||
fgets(ds, 6, fin);
|
||||
sscanf(ds,"%d",&DemoTextYstart);
|
||||
for (i = 0; TRUE; i++)
|
||||
for (i = 0; i < ARRAY_SSIZE(DemoText); i++)
|
||||
{
|
||||
if (fgets(DemoText[i], SIZ(DemoText[0])-1, fin) == NULL)
|
||||
break;
|
||||
}
|
||||
if (i == ARRAY_SSIZE(DemoText))
|
||||
initputs("WARNING: demotxt.run is too long, trimming the text\n");
|
||||
|
||||
fclose(fin);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue