forked from enlightenment/efl
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:
parent
99930c1a59
commit
3731398622
|
@ -2190,7 +2190,8 @@ data_thread_script(void *data, Ecore_Thread *thread EINA_UNUSED)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
fseek(f, 0, SEEK_END);
|
if (fseek(f, 0, SEEK_END) < 0)
|
||||||
|
ERR("Error seeking");
|
||||||
size = ftell(f);
|
size = ftell(f);
|
||||||
rewind(f);
|
rewind(f);
|
||||||
|
|
||||||
|
|
|
@ -63,9 +63,11 @@ source_fetch_file(const char *fil, const char *filname)
|
||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
fseek(f, 0, SEEK_END);
|
if (fseek(f, 0, SEEK_END) < 0)
|
||||||
|
ERR("Error seeking");
|
||||||
sz = ftell(f);
|
sz = ftell(f);
|
||||||
fseek(f, 0, SEEK_SET);
|
if (fseek(f, 0, SEEK_SET) < 0)
|
||||||
|
ERR("Error seeking");
|
||||||
sf = mem_alloc(SZ(SrcFile));
|
sf = mem_alloc(SZ(SrcFile));
|
||||||
sf->name = mem_strdup(filname);
|
sf->name = mem_strdup(filname);
|
||||||
sf->file = mem_alloc(sz + 1);
|
sf->file = mem_alloc(sz + 1);
|
||||||
|
@ -80,7 +82,8 @@ source_fetch_file(const char *fil, const char *filname)
|
||||||
}
|
}
|
||||||
|
|
||||||
sf->file[sz] = '\0';
|
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);
|
srcfiles.list = eina_list_append(srcfiles.list, sf);
|
||||||
|
|
||||||
while (fgets(buf, sizeof(buf), f))
|
while (fgets(buf, sizeof(buf), f))
|
||||||
|
|
Loading…
Reference in New Issue