elm map - fix incorrect return check of fread
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>
Fri, 10 Jan 2014 07:51:06 +0000 (16:51 +0900)
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>
Fri, 10 Jan 2014 07:51:06 +0000 (16:51 +0900)
this fixes CID 1132737 (a real bug)

src/lib/elm_map.c

index 01b1d24..67aa3d9 100644 (file)
@@ -2806,7 +2806,7 @@ _kml_parse(Elm_Map_Route *r)
    f = fopen(r->fname, "rb");
    if (f)
      {
-        long sz;
+        unsigned long sz;
 
         fseek(f, 0, SEEK_END);
         sz = ftell(f);
@@ -2817,7 +2817,7 @@ _kml_parse(Elm_Map_Route *r)
                {
                   memset(buf, 0, sz + 1);
                   rewind(f);
-                  if (fread(buf, 1, sz, f))
+                  if (fread(buf, 1, sz, f) == sz)
                     {
                        eina_simple_xml_parse
                          (buf, sz, EINA_TRUE, _xml_route_dump_cb, &dump);