Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/littlefs-project/littlefs.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lfs.c
diff options
context:
space:
mode:
authorChristopher Haster <chaster@utexas.edu>2018-02-04 22:48:44 +0300
committerChristopher Haster <chaster@utexas.edu>2018-02-04 23:09:55 +0300
commit6716b5580af841c379edbdd1ba2a558ebce0cb58 (patch)
tree5aff1dde9bb2aa2e4bc2e1c8c3817672c7cefc39 /lfs.c
parent809ffde60fdadd4640acead675990757c9b762bc (diff)
Fixed error check when truncating files to larger size
Diffstat (limited to 'lfs.c')
-rw-r--r--lfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lfs.c b/lfs.c
index 514a85b..1e490c0 100644
--- a/lfs.c
+++ b/lfs.c
@@ -1694,7 +1694,7 @@ int lfs_file_truncate(lfs_t *lfs, lfs_file_t *file, lfs_off_t size) {
// flush+seek if not already at end
if (file->pos != oldsize) {
int err = lfs_file_seek(lfs, file, 0, SEEK_END);
- if (err) {
+ if (err < 0) {
return err;
}
}