Skip to content

Commit 625501a

Browse files
authored
Merge pull request #435 from danielinux/fix-warning-array-subscript
Added explicit cast to silence warning
2 parents 7f2305d + 32b5b9e commit 625501a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libwolfboot.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,8 @@ static int RAMFUNCTION nvm_select_fresh_sector(int part)
240240
#endif
241241

242242
/* check magic in case the sector is corrupt */
243-
word_0 = *((uint32_t*)(base - sizeof(uint32_t)));
244-
word_1 = *((uint32_t*)(base - WOLFBOOT_SECTOR_SIZE - sizeof(uint32_t)));
243+
word_0 = *((uint32_t*)((uintptr_t)base - sizeof(uint32_t)));
244+
word_1 = *((uint32_t*)((uintptr_t)base - WOLFBOOT_SECTOR_SIZE - sizeof(uint32_t)));
245245

246246
if (word_0 == WOLFBOOT_MAGIC_TRAIL && word_1 != WOLFBOOT_MAGIC_TRAIL) {
247247
sel = 0;

0 commit comments

Comments
 (0)