From c58750cf564989a37d9b772b3aaa9cff0168daf8 Mon Sep 17 00:00:00 2001 From: "sonika.rathi" Date: Thu, 16 Jul 2026 09:52:08 +0200 Subject: [PATCH] fix(spiffs): shorten obj_name_len guard comment --- components/spiffs/spiffsgen.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/components/spiffs/spiffsgen.py b/components/spiffs/spiffsgen.py index 77a1b8d155b..d73c6f1a938 100755 --- a/components/spiffs/spiffsgen.py +++ b/components/spiffs/spiffsgen.py @@ -403,12 +403,7 @@ class SpiffsFS(object): return self.remaining_blocks <= 0 def create_file(self, img_path, file_path): # type: (str, str) -> None - # obj_name_len includes the zero-termination character (see Kconfig - # help for CONFIG_SPIFFS_OBJ_NAME_LEN), so the maximum number of - # actual name characters is obj_name_len - 1. Without the "- 1" here, - # a name exactly obj_name_len characters long is wrongly accepted and - # SpiffsObjIndexPage.to_binary() ends up writing zero NUL bytes into - # the reserved name field. + # obj_name_len includes NUL (CONFIG_SPIFFS_OBJ_NAME_LEN); max chars is obj_name_len - 1. if len(img_path) > self.build_config.obj_name_len - 1: raise RuntimeError("object name '%s' too long" % img_path)