Skip to content

Commit

Permalink
Added explicit cast to silence warning
Browse files Browse the repository at this point in the history
Explicit cast to silence warning about negative array index
  • Loading branch information
danielinux committed Apr 16, 2024
1 parent 1db4189 commit d8c651c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/libwolfboot.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,8 @@ static int RAMFUNCTION nvm_select_fresh_sector(int part)
#endif

/* check magic in case the sector is corrupt */
word_0 = *((uint32_t*)(base - sizeof(uint32_t)));
word_1 = *((uint32_t*)(base - WOLFBOOT_SECTOR_SIZE - sizeof(uint32_t)));
word_0 = *((uint32_t*)((uint32_t)base - sizeof(uint32_t)));
word_1 = *((uint32_t*)((uint32_t)base - WOLFBOOT_SECTOR_SIZE - sizeof(uint32_t)));

if (word_0 == WOLFBOOT_MAGIC_TRAIL && word_1 != WOLFBOOT_MAGIC_TRAIL) {
sel = 0;
Expand Down

0 comments on commit d8c651c

Please sign in to comment.