From e8d5263aca3beef30241f7e1cdf49bbbcbd48670 Mon Sep 17 00:00:00 2001 From: Dan Bechard Date: Mon, 6 Dec 2021 17:25:45 -0500 Subject: [PATCH] Fix insert when buffer full --- src/extras/raygui.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/extras/raygui.h b/src/extras/raygui.h index 3f7f03488..e7555327d 100644 --- a/src/extras/raygui.h +++ b/src/extras/raygui.h @@ -1427,7 +1427,6 @@ static int rstb_InsertChars(rstb_String *str, int start, int *chars, int count) { assert(start >= 0); assert(count > 0); - assert(str->used + count < str->capacity); int success = 0; // TODO(dbechrd): Unicode support, currently assumes ASCII @@ -1460,9 +1459,9 @@ static int rstb_InsertChars(rstb_String *str, int start, int *chars, int count) memcpy(str->buffer + start, chars, count); } success = 1; + str->used += count; } - str->used += count; assert(str->used < str->capacity); return success; }