From 55fb1416c7fef25f90c17b87edd05b2cdd4b6a46 Mon Sep 17 00:00:00 2001 From: "Peter A. Bigot" Date: Sat, 3 Aug 2019 09:40:10 -0500 Subject: [PATCH] lfs: initialize file offs field The uninitialized value creates confusion when diagnosing anomalies. Signed-off-by: Peter A. Bigot --- lfs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lfs.c b/lfs.c index 9fad1f9..c4ef89a 100644 --- a/lfs.c +++ b/lfs.c @@ -2329,6 +2329,7 @@ int lfs_file_opencfg(lfs_t *lfs, lfs_file_t *file, file->cfg = cfg; file->flags = flags | LFS_F_OPENED; file->pos = 0; + file->off = 0; file->cache.buffer = NULL; // allocate entry for file if it doesn't exist