forked from enlightenment/efl
ftell can return -1 to indicate error, so trap for that
Fixes Coverity CID1039358 Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
parent
41a700b2d5
commit
7575883a56
|
@ -328,6 +328,13 @@ do_eet_encode(const char *file,
|
||||||
|
|
||||||
fseek(f, 0, SEEK_END);
|
fseek(f, 0, SEEK_END);
|
||||||
textlen = ftell(f);
|
textlen = ftell(f);
|
||||||
|
if (textlen < 0)
|
||||||
|
{
|
||||||
|
ERR("cannot obtain current file position %s", out);
|
||||||
|
fclose(f);
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
|
|
||||||
rewind(f);
|
rewind(f);
|
||||||
text = malloc(textlen);
|
text = malloc(textlen);
|
||||||
if (!text)
|
if (!text)
|
||||||
|
|
Loading…
Reference in New Issue