edje_cc: check return value of fseeks

Reviewers: Jaehyun_Cho, zmike

Reviewed By: Jaehyun_Cho

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7796
This commit is contained in:
Yeongjong Lee 2019-01-28 17:26:09 +09:00 committed by Jaehyun Cho
parent 99930c1a59
commit 3731398622
2 changed files with 8 additions and 4 deletions

View File

@ -2190,7 +2190,8 @@ data_thread_script(void *data, Ecore_Thread *thread EINA_UNUSED)
return;
}
fseek(f, 0, SEEK_END);
if (fseek(f, 0, SEEK_END) < 0)
ERR("Error seeking");
size = ftell(f);
rewind(f);

View File

@ -63,9 +63,11 @@ source_fetch_file(const char *fil, const char *filname)
exit(-1);
}
fseek(f, 0, SEEK_END);
if (fseek(f, 0, SEEK_END) < 0)
ERR("Error seeking");
sz = ftell(f);
fseek(f, 0, SEEK_SET);
if (fseek(f, 0, SEEK_SET) < 0)
ERR("Error seeking");
sf = mem_alloc(SZ(SrcFile));
sf->name = mem_strdup(filname);
sf->file = mem_alloc(sz + 1);
@ -80,7 +82,8 @@ source_fetch_file(const char *fil, const char *filname)
}
sf->file[sz] = '\0';
fseek(f, 0, SEEK_SET);
if (fseek(f, 0, SEEK_SET) < 0)
ERR("Error seeking");
srcfiles.list = eina_list_append(srcfiles.list, sf);
while (fgets(buf, sizeof(buf), f))