Merge pull request #306 from elupus/patch-2

Fix page allocation condition in spiffs_nucleus.c
This commit is contained in:
Peter Andersson
2026-06-18 17:27:19 +02:00
committed by GitHub
+1
View File
@@ -1571,6 +1571,7 @@ s32_t spiffs_object_modify(spiffs_fd *fd, u32_t offset, u8_t *data, u32_t len) {
// a full page, allocate and write a new page of data
res = spiffs_page_allocate_data(fs, fd->obj_id & ~SPIFFS_OBJ_ID_IX_FLAG,
&p_hdr, &data[written], to_write, page_offs, 1, &data_pix);
if (res != SPIFFS_OK) break;
SPIFFS_DBG("modify: store new data page, "_SPIPRIpg":"_SPIPRIsp" offset:"_SPIPRIi", len "_SPIPRIi", written "_SPIPRIi"\n", data_pix, data_spix, page_offs, to_write, written);
} else {
// write to existing page, allocate new and copy unmodified data