mirror of
https://github.com/Shpoike/Quakespasm.git
synced 2024-11-10 07:21:58 +00:00
host_cmd.c (Host_Loadgame_f): Close the file before signalling an error
(noticed this in recent RMQ sources.) git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@518 af15c1b1-3010-417e-b628-4374ebc0bcbd
This commit is contained in:
parent
8625074bb4
commit
abd0089b8a
1 changed files with 7 additions and 0 deletions
|
@ -1158,6 +1158,7 @@ void Host_Loadgame_f (void)
|
|||
|
||||
if (!sv.active)
|
||||
{
|
||||
fclose (f);
|
||||
Con_Printf ("Couldn't load map\n");
|
||||
return;
|
||||
}
|
||||
|
@ -1189,14 +1190,20 @@ void Host_Loadgame_f (void)
|
|||
}
|
||||
}
|
||||
if (i == sizeof(str) - 1)
|
||||
{
|
||||
fclose (f);
|
||||
Sys_Error ("Loadgame buffer overflow");
|
||||
}
|
||||
str[i] = 0;
|
||||
start = str;
|
||||
start = COM_Parse(str);
|
||||
if (!com_token[0])
|
||||
break; // end of file
|
||||
if (strcmp(com_token,"{"))
|
||||
{
|
||||
fclose (f);
|
||||
Sys_Error ("First token isn't a brace");
|
||||
}
|
||||
|
||||
if (entnum == -1)
|
||||
{ // parse the global vars
|
||||
|
|
Loading…
Reference in a new issue