mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-14 15:07:57 +00:00
Avoid assertion failure when loading an empty data file.
This commit is contained in:
parent
d488cb3e70
commit
09c68d9dd5
|
@ -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);
|
||||||
|
if (rd->size)
|
||||||
|
{
|
||||||
rd->data = (char *)xmalloc(rd->size);
|
rd->data = (char *)xmalloc(rd->size);
|
||||||
fread(rd->data, rd->size, 1, fp);
|
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);
|
||||||
|
|
Loading…
Reference in a new issue