Commit 09c68d9d authored by Alexandre Julliard's avatar Alexandre Julliard

Avoid assertion failure when loading an empty data file.

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