Skip to content

Commit

Permalink
ptunit, image: avoid static analyzer warning
Browse files Browse the repository at this point in the history
Signed-off-by: Markus Metzger <[email protected]>
  • Loading branch information
markus-metzger committed Jan 21, 2025
1 parent 0a8fe5c commit a5e4ad5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions libipt/test/src/ptunit-image.c
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,8 @@ static struct ptunit_result same_different_isid(struct image_fixture *ifix)

static struct ptunit_result same_different_offset(struct image_fixture *ifix)
{
uint8_t buffer[] = { 0xcc, 0xcc }, i;
uint64_t idx;
uint8_t buffer[] = { 0xcc, 0xcc };
int status, isid, index;

/* Add another section from a different part of the same file as an
Expand All @@ -906,8 +907,8 @@ static struct ptunit_result same_different_offset(struct image_fixture *ifix)
ptu_uint_eq(ifix->section[index].size, ifix->section[0].size);

/* Change the content of the new section so we can distinguish them. */
for (i = 0; i < ifix->mapping[index].size; ++i)
ifix->mapping[index].content[i] += 0x10;
for (idx = 0; idx < ifix->mapping[index].size; ++idx)
ifix->mapping[index].content[idx] += 0x10;


status = pt_image_add(&ifix->image, &ifix->section[0], &ifix->asid[0],
Expand Down

0 comments on commit a5e4ad5

Please sign in to comment.