Skip to content

Commit b12f0c2

Browse files
author
Rohit Grover
committed
take care of a compiler warning
1 parent 7b110f0 commit b12f0c2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

hal/targets/hal/TARGET_Freescale/TARGET_KSDK2_MCUS/TARGET_K64F/storage_driver.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -982,7 +982,7 @@ int32_t nextBlock(const ARM_STORAGE_BLOCK *prevP, ARM_STORAGE_BLOCK *nextP)
982982
}
983983

984984
static const size_t NUM_SEGMENTS = sizeof(blockTable) / sizeof(ARM_STORAGE_BLOCK);
985-
for (size_t index = 0; index < (NUM_SEGMENTS - 1); index++) {
985+
for (size_t index = 0; (NUM_SEGMENTS > 1) && (index < (NUM_SEGMENTS - 1)); index++) {
986986
if ((blockTable[index].addr == prevP->addr) && (blockTable[index].size == prevP->size)) {
987987
if (nextP) {
988988
memcpy(nextP, &blockTable[index + 1], sizeof(ARM_STORAGE_BLOCK));

0 commit comments

Comments
 (0)