mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-08 23:19:40 +00:00
(svn r19427) -Codechange: gracefully handle the case where we can't open a .tar file.
This commit is contained in:
parent
ede670918a
commit
4ba69b572d
@ -563,7 +563,11 @@ bool TarListAddFile(const char *filename)
|
||||
if (it != _tar_list.end()) return false;
|
||||
|
||||
FILE *f = fopen(filename, "rb");
|
||||
assert(f != NULL);
|
||||
/* Although the file has been found there can be
|
||||
* a number of reasons we cannot open the file.
|
||||
* Most common case is when we simply have not
|
||||
* been given read access. */
|
||||
if (f == NULL) return false;
|
||||
|
||||
const char *dupped_filename = strdup(filename);
|
||||
_tar_list[filename].filename = dupped_filename;
|
||||
|
Loading…
Reference in New Issue
Block a user