elm map - fix incorrect return check of fread

this fixes CID 1132736 (real bug)
This commit is contained in:
Carsten Haitzler 2014-01-10 16:52:44 +09:00
parent 900ae28870
commit 1ac66c892a
1 changed files with 2 additions and 2 deletions

View File

@ -2896,7 +2896,7 @@ _name_parse(Elm_Map_Name *n)
f = fopen(n->fname, "rb"); f = fopen(n->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);
@ -2907,7 +2907,7 @@ _name_parse(Elm_Map_Name *n)
{ {
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_cb, &dump); (buf, sz, EINA_TRUE, _xml_name_dump_cb, &dump);