Don't crash when trying to open a empty file

Signed-off-by: Anton Lundin <glance@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Anton Lundin 2013-12-09 07:42:51 +01:00 committed by Dirk Hohndel
parent 44848d5457
commit 3b115b9400

3
file.c
View file

@ -291,6 +291,9 @@ static void parse_file_buffer(const char *filename, struct memblock *mem, char *
if (fmt && open_by_filename(filename, fmt+1, mem, error))
return;
if (!mem->size || !mem->buffer)
return;
parse_xml_buffer(filename, mem->buffer, mem->size, &dive_table, NULL, error);
}