Ensured that ecl_file_len() doesn't return a random value on error.

This partially addresses CID 66411 (Unchecked return value from library).
The call to fstat() should still probably have error checking added.
This commit is contained in:
Arto Bendiken 2014-10-14 22:02:12 +00:00
parent 8e714e3a55
commit e13c07bd4a

View file

@ -454,6 +454,7 @@ cl_object
ecl_file_len(int f)
{
struct stat filestatus;
memset(&filestatus, 0, sizeof(filestatus));
ecl_disable_interrupts();
fstat(f, &filestatus);
ecl_enable_interrupts();