projects
/
platform
/
upstream
/
efl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fc159fb
)
eolian: fread fix
author
Daniel Kolesa
<d.kolesa@samsung.com>
Mon, 4 Aug 2014 09:56:15 +0000
(10:56 +0100)
committer
Daniel Kolesa
<d.kolesa@samsung.com>
Mon, 4 Aug 2014 09:56:35 +0000
(10:56 +0100)
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.
src/bin/eolian/main.c
patch
|
blob
|
history
diff --git
a/src/bin/eolian/main.c
b/src/bin/eolian/main.c
index 2b66a8917f61a350456d60f58b5d2e423171b5ed..0b288d1d385b7a7db94f2f500d9f8fa7d562c422 100644
(file)
--- a/
src/bin/eolian/main.c
+++ b/
src/bin/eolian/main.c
@@
-67,10
+67,11
@@
_read_file(char *filename, Eina_Strbuf *buffer)
ERR("Couldnt allocate memory for file %s", filename);
goto end;
}
- long actual_size = (long)fread(content,
file_size, 1
, fd);
+ long actual_size = (long)fread(content,
1, file_size
, fd);
if (actual_size != file_size)
{
- ERR("Couldnt read the %ld bytes of file %s", file_size, filename);
+ ERR("Couldnt read the %ld bytes of file %s (read %ld bytes)",
+ file_size, filename, actual_size);
free(content);
goto end;
}