From 38abba66cf9b41712876024fcd5dbafe66fd1a67 Mon Sep 17 00:00:00 2001 From: Thulinma Date: Tue, 16 Aug 2022 12:13:50 +0200 Subject: [PATCH] Improved "Exceeding recordCount" message to show at the correct times --- lib/util.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/util.cpp b/lib/util.cpp index cba9deae..9a8fa343 100644 --- a/lib/util.cpp +++ b/lib/util.cpp @@ -928,9 +928,9 @@ namespace Util{ /// Updates the present record counter, shifting the ring buffer end position forward without /// moving the ring buffer start position. void RelAccX::addRecords(uint32_t amount){ - if ((*hdrPresent) + amount > *hdrRecordCnt){ + if ((*hdrEndPos) + amount - *hdrDeleted > *hdrRecordCnt){ BACKTRACE; - WARN_MSG("Exceeding recordCount (%d [%d + %d] > %d)", (*hdrPresent) + amount, *hdrPresent, amount, *hdrRecordCnt); + WARN_MSG("Exceeding recordCount (%" PRIu64 " [%" PRIu64 " + %" PRIu32 " - %" PRIu64 "] > %" PRIu32 ")", (*hdrEndPos) + amount - (*hdrDeleted), *hdrEndPos, amount, *hdrDeleted, *hdrRecordCnt); *hdrPresent = 0; }else{ *hdrPresent += amount;