Changeset - r14826:6c3ace5f137c
[Not reviewed]
master
0 1 0
rubidium - 14 years ago 2010-03-15 17:44:54
rubidium@openttd.org
(svn r19427) -Codechange: gracefully handle the case where we can't open a .tar file.
1 file changed with 5 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/fileio.cpp
Show inline comments
 
@@ -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;
0 comments (0 inline, 0 general)