Skip to content
Snippets Groups Projects
Commit 09c68d9d authored by Alexandre Julliard's avatar Alexandre Julliard
Browse files

Avoid assertion failure when loading an empty data file.

parent d488cb3e
No related branches found
No related tags found
No related merge requests found
......@@ -2306,8 +2306,12 @@ static raw_data_t *load_file(string_t *filename, language_t *lang)
fseek(fp, 0, SEEK_END);
rd->size = ftell(fp);
fseek(fp, 0, SEEK_SET);
rd->data = (char *)xmalloc(rd->size);
fread(rd->data, rd->size, 1, fp);
if (rd->size)
{
rd->data = (char *)xmalloc(rd->size);
fread(rd->data, rd->size, 1, fp);
}
else rd->data = NULL;
fclose(fp);
rd->lvc.language = lang;
free_string(name);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment