Removed dependency on uninitialized value in lfs_file_t struct

This commit is contained in:
Christopher Haster
2019-07-29 00:43:54 -05:00
parent 501b0240a9
commit e249854858

3
lfs.c
View File

@@ -2308,9 +2308,6 @@ int lfs_file_opencfg(lfs_t *lfs, lfs_file_t *file,
(void*)lfs, (void*)file, path, flags, (void*)lfs, (void*)file, path, flags,
(void*)cfg, cfg->buffer, (void*)cfg->attrs, cfg->attr_count); (void*)cfg, cfg->buffer, (void*)cfg->attrs, cfg->attr_count);
// do not allow open for already opened file
LFS_ASSERT(0 == (file->flags & LFS_F_OPENED));
// deorphan if we haven't yet, needed at most once after poweron // deorphan if we haven't yet, needed at most once after poweron
if ((flags & 3) != LFS_O_RDONLY) { if ((flags & 3) != LFS_O_RDONLY) {
int err = lfs_fs_forceconsistency(lfs); int err = lfs_fs_forceconsistency(lfs);