From 3776158d991bb23acba9e9e38189172f25c5a208 Mon Sep 17 00:00:00 2001 From: JoshuaMoelans <60878493+JoshuaMoelans@users.noreply.github.com> Date: Tue, 29 Oct 2024 10:47:23 +0100 Subject: [PATCH] fixed ringbuffer to list conversion --- src/sentry_value.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sentry_value.c b/src/sentry_value.c index a87a08cd6..5e6725a96 100644 --- a/src/sentry_value.c +++ b/src/sentry_value.c @@ -838,9 +838,9 @@ sentry__value_ring_buffer_to_list(const sentry_value_t rb) const int32_t start_idx = sentry_value_as_int32(rb_list->items[0]); sentry_value_t rv = sentry_value_new_list(); - for (size_t i = 0; i < rb_list->len; i++) { + for (size_t i = 0; i < rb_list->len - 1; i++) { const sentry_value_t v - = rb_list->items[((start_idx + i) % rb_list->len) + 1]; + = rb_list->items[(start_idx - 1 + i) % (rb_list->len - 1) + 1]; sentry_value_incref(v); sentry_value_append(rv, v); }