- if (fs_file_seek(fp, 0, SEEK_END) != 0 || ((len = fs_file_tell(fp)) < 0)) {
- fs_file_close(fp);
- return false;
- }
- fs_file_seek(fp, 0, SEEK_SET);
+ if (fs_file_seek(fp, 0, FS_FILE_SEEK_END) != 0 || ((len = fs_file_tell(fp)) < 0))
+ goto err;
+ if (fs_file_seek(fp, 0, FS_FILE_SEEK_SET) != 0)
+ goto err;