Fixed usage of 8-bit modulo operator off-by-one maximum. (#901)

This commit is contained in:
Steve Karg
2025-02-04 13:56:53 -06:00
committed by GitHub
parent 19ef7f74cd
commit 77bdaaf853
5 changed files with 7 additions and 7 deletions
+2 -2
View File
@@ -45,7 +45,7 @@ static void testRingAroundBuffer(
/* test the ring around the buffer */
for (index = 0; index < element_count; index++) {
for (count = 1; count < 4; count++) {
value = (index * count) % 255;
value = (index * count) % 256;
for (data_index = 0; data_index < element_size; data_index++) {
data_element[data_index] = value;
}
@@ -54,7 +54,7 @@ static void testRingAroundBuffer(
zassert_equal(Ringbuf_Count(test_buffer), count, NULL);
}
for (count = 1; count < 4; count++) {
value = (index * count) % 255;
value = (index * count) % 256;
test_data = Ringbuf_Peek(test_buffer);
zassert_not_null(test_data, NULL);
if (test_data) {