Skip to content

Commit 943feea

Browse files
committed
Fix pointer truncation
pellepl/spiffs#45
1 parent 862a237 commit 943feea

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spiffs/spiffs_gc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ s32_t spiffs_gc_find_candidate(
255255
// align cand_scores on s32_t boundary
256256
#pragma GCC diagnostic push
257257
#pragma GCC diagnostic ignored "-Wpointer-to-int-cast"
258-
cand_scores = (s32_t*)(((u32_t)cand_scores + sizeof(s32_t) - 1) & ~(sizeof(s32_t) - 1));
258+
cand_scores = (s32_t*)(((ptrdiff_t)cand_scores + sizeof(ptrdiff_t) - 1) & ~(sizeof(ptrdiff_t) - 1));
259259
#pragma GCC diagnostic pop
260260

261261
*block_candidates = cand_blocks;

0 commit comments

Comments
 (0)