summaryrefslogtreecommitdiff
path: root/src/bin/eolian
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@samsung.com>2014-08-04 10:56:15 +0100
committerDaniel Kolesa <d.kolesa@samsung.com>2014-08-04 10:56:35 +0100
commit8c677a1f0ea59a7403522d3252a3c886ed552b72 (patch)
treebf81b057a6225ed362a15be771a4dfe974f48f0c /src/bin/eolian
parentfc159fbcaef87b2bcfa5ec33b47ea4ff2875727c (diff)
eolian: fread fix
Instead of 1 element of size N, we should read N elements of size 1 in order to sensibly compare the result with the result of calling ftell.
Diffstat (limited to 'src/bin/eolian')
-rw-r--r--src/bin/eolian/main.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/bin/eolian/main.c b/src/bin/eolian/main.c
index 2b66a8917f..0b288d1d38 100644
--- a/src/bin/eolian/main.c
+++ b/src/bin/eolian/main.c
@@ -67,10 +67,11 @@ _read_file(char *filename, Eina_Strbuf *buffer)
67 ERR("Couldnt allocate memory for file %s", filename); 67 ERR("Couldnt allocate memory for file %s", filename);
68 goto end; 68 goto end;
69 } 69 }
70 long actual_size = (long)fread(content, file_size, 1, fd); 70 long actual_size = (long)fread(content, 1, file_size, fd);
71 if (actual_size != file_size) 71 if (actual_size != file_size)
72 { 72 {
73 ERR("Couldnt read the %ld bytes of file %s", file_size, filename); 73 ERR("Couldnt read the %ld bytes of file %s (read %ld bytes)",
74 file_size, filename, actual_size);
74 free(content); 75 free(content);
75 goto end; 76 goto end;
76 } 77 }