Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit 3a730df

Browse files
glandiumJason Evans
authored and
Jason Evans
committed
Avoid pointer arithmetic on void* in test/integration/rallocx.c
1 parent 86e2e70 commit 3a730df

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

test/integration/rallocx.c

+5-3
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ TEST_BEGIN(test_zero)
9595
"Expected zeroed memory");
9696
}
9797
if (psz != qsz) {
98-
memset(q+psz, FILL_BYTE, qsz-psz);
98+
memset((void *)(uintptr_t)q+psz, FILL_BYTE,
99+
qsz-psz);
99100
psz = qsz;
100101
}
101102
p = q;
@@ -159,8 +160,9 @@ TEST_BEGIN(test_lg_align_and_zero)
159160
} else {
160161
assert_false(validate_fill(q, 0, 0, MAX_VALIDATE),
161162
"Expected zeroed memory");
162-
assert_false(validate_fill(q+sz-MAX_VALIDATE, 0, 0,
163-
MAX_VALIDATE), "Expected zeroed memory");
163+
assert_false(validate_fill(
164+
(void *)(uintptr_t)q+sz-MAX_VALIDATE,
165+
0, 0, MAX_VALIDATE), "Expected zeroed memory");
164166
}
165167
p = q;
166168
}

0 commit comments

Comments
 (0)