From 7b7c0c83ef3d52695b7c939ad181e7ca3faddbf6 Mon Sep 17 00:00:00 2001 From: Mingjie Shen Date: Sat, 22 Apr 2023 04:13:11 -0400 Subject: [PATCH] Fix offset used before range check (#3021) This use of offset 'i' should follow the range check. --- examples/shapes/raygui.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/shapes/raygui.h b/examples/shapes/raygui.h index 112370ac..ea95e5c8 100644 --- a/examples/shapes/raygui.h +++ b/examples/shapes/raygui.h @@ -3743,7 +3743,7 @@ static int GetTextWidth(const char *text) { if (text[0] == '#') { - for (int i = 1; (text[i] != '\0') && (i < 5); i++) + for (int i = 1; (i < 5) && (text[i] != '\0'); i++) { if (text[i] == '#') {