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
diff options
context:
space:
mode:
authorChristopher Haster <geky@geky.net>2024-01-17 08:40:30 +0300
committerChristopher Haster <geky@geky.net>2024-01-17 08:40:30 +0300
commit6691718b18def310516d1e7724fece766c7c09b1 (patch)
tree257bbebb8d8c2df03d96fcb4cc6a68e62229a213
parent1fefcbbcba6875a4e0d140eaa8486a36cf4f45f0 (diff)
Restricted LFS_FILE_MAX to signed 32-bits, <2^31, <=2147483647
I think realistically no one is using this. It's already only partially supported and untested. Worst case, if someone does depend on this we can always revert.
-rw-r--r--lfs.c4
-rw-r--r--lfs.h6
2 files changed, 4 insertions, 6 deletions
diff --git a/lfs.c b/lfs.c
index 3d716ac..9e1fdb6 100644
--- a/lfs.c
+++ b/lfs.c
@@ -4112,8 +4112,8 @@ static int lfs_rawremoveattr(lfs_t *lfs, const char *path, uint8_t type) {
#error "Invalid LFS_NAME_MAX, must be <= 1022"
#endif
-#if LFS_FILE_MAX > 4294967295
-#error "Invalid LFS_FILE_MAX, must be <= 4294967295"
+#if LFS_FILE_MAX > 2147483647
+#error "Invalid LFS_FILE_MAX, must be <= 2147483647"
#endif
#if LFS_ATTR_MAX > 1022
diff --git a/lfs.h b/lfs.h
index d7f6136..452dd0e 100644
--- a/lfs.h
+++ b/lfs.h
@@ -52,10 +52,8 @@ typedef uint32_t lfs_block_t;
#endif
// Maximum size of a file in bytes, may be redefined to limit to support other
-// drivers. Limited on disk to <= 4294967295. However, above 2147483647 the
-// functions lfs_file_seek, lfs_file_size, and lfs_file_tell will return
-// incorrect values due to using signed integers. Stored in superblock and
-// must be respected by other littlefs drivers.
+// drivers. Limited on disk to <= 2147483647. Stored in superblock and must be
+// respected by other littlefs drivers.
#ifndef LFS_FILE_MAX
#define LFS_FILE_MAX 2147483647
#endif