From 56b17bf4f1f820602f0630644e214e56a9acdab6 Mon Sep 17 00:00:00 2001 From: Mingjie Shen Date: Fri, 21 Apr 2023 01:39:23 -0400 Subject: [PATCH] Fix offset used before range check 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 112370aca795..ea95e5c85b33 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] == '#') {