From 6b438ed578daa7859b92b8dfb0ec3d85b1a59188 Mon Sep 17 00:00:00 2001 From: Raymaekers Luca Date: Tue, 19 Nov 2024 11:37:50 +0100 Subject: Fixed bug FormatIndexes going out of bounds --- ui.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ui.c') diff --git a/ui.c b/ui.c index c2e0ac9..8d7cab4 100644 --- a/ui.c +++ b/ui.c @@ -182,13 +182,13 @@ tb_print_wrapped_with_markdown(u32 XOffset, u32 YOffset, u32 fg, u32 bg, for (u32 TextIndex = 0; TextIndex < Len; TextIndex++) { - if (MDFormat.Len && + if (MDFormatOptionsIndex < MDFormat.Len && TextIndex == MDFormat.Options[MDFormatOptionsIndex].Position) { fg ^= MDFormat.Options[MDFormatOptionsIndex].Color; MDFormatOptionsIndex++; } - if (WrapPositionsLen && + if (WrapPositionsIndex < WrapPositionsLen && TextIndex == WrapPositions[WrapPositionsIndex]) { Y++; -- cgit v1.2.3