From ee6264df4e2c47e0dd186e66095999c89b018ac2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20=C5=81yszczek?= Date: Sat, 14 Apr 2018 06:44:38 -0600 Subject: [PATCH] fs/smartfs: Fix a hardfault in SmartFS. Problem occurred when opening a file with O_CREAT (only) when the file arelready exists but has a size of zero. --- fs/smartfs/smartfs_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/smartfs/smartfs_utils.c b/fs/smartfs/smartfs_utils.c index 5071030c41..100ba8cda9 100644 --- a/fs/smartfs/smartfs_utils.c +++ b/fs/smartfs/smartfs_utils.c @@ -1823,7 +1823,7 @@ int smartfs_shrinkfile(FAR struct smartfs_mountpt_s *fs, if (length == 0) { - dest = (FAR uint8_t *)&sf->buffer; + dest = (FAR uint8_t *)sf->buffer; destsize = fs->fs_llformat.availbytes; } else