Rename misleading local variable
The local variable 'size' is actually the offset of the end, and not the
size. Rename it to reflect this reality.
Signed-off-by: David Brown <david.brown@linaro.org>
diff --git a/boot/bootutil/src/image_validate.c b/boot/bootutil/src/image_validate.c
index c9144cb..06d077c 100644
--- a/boot/bootutil/src/image_validate.c
+++ b/boot/bootutil/src/image_validate.c
@@ -144,7 +144,7 @@
uint8_t *seed, int seed_len, uint8_t *out_hash)
{
uint32_t off;
- uint32_t size;
+ uint32_t end;
int sha256_valid = 0;
struct image_tlv_info info;
#ifdef EXPECTED_SIG_TLV
@@ -177,14 +177,14 @@
if (info.it_magic != IMAGE_TLV_INFO_MAGIC) {
return -1;
}
- size = off + info.it_tlv_tot;
+ end = off + info.it_tlv_tot;
off += sizeof(info);
/*
* Traverse through all of the TLVs, performing any checks we know
* and are able to do.
*/
- for (; off < size; off += sizeof(tlv) + tlv.it_len) {
+ for (; off < end; off += sizeof(tlv) + tlv.it_len) {
rc = flash_area_read(fap, off, &tlv, sizeof tlv);
if (rc) {
return rc;