elm map - fix incorrect return check of fread

this fixes CID 1132735 (real bug)
This commit is contained in:
Carsten Haitzler 2014-01-10 16:53:43 +09:00
parent 1ac66c892a
commit 0c9480fc76
1 changed files with 2 additions and 2 deletions

View File

@ -2937,7 +2937,7 @@ _name_list_parse(Elm_Map_Name_List *nl)
f = fopen(nl->fname, "rb"); f = fopen(nl->fname, "rb");
if (f) if (f)
{ {
long sz; unsigned long sz;
fseek(f, 0, SEEK_END); fseek(f, 0, SEEK_END);
sz = ftell(f); sz = ftell(f);
@ -2948,7 +2948,7 @@ _name_list_parse(Elm_Map_Name_List *nl)
{ {
memset(buf, 0, sz + 1); memset(buf, 0, sz + 1);
rewind(f); rewind(f);
if (fread(buf, 1, sz, f)) if (fread(buf, 1, sz, f) == sz)
{ {
eina_simple_xml_parse eina_simple_xml_parse
(buf, sz, EINA_TRUE, _xml_name_dump_list_cb, nl); (buf, sz, EINA_TRUE, _xml_name_dump_list_cb, nl);