fix(spiffs): shorten obj_name_len guard comment

This commit is contained in:
sonika.rathi
2026-07-16 09:52:08 +02:00
parent e628a207ac
commit 7fe0c2392f
+1 -6
View File
@@ -423,12 +423,7 @@ class SpiffsFS:
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:
log.die(f"object name '{img_path}' too long")