Skip to content

Commit

Permalink
Fix offset used before range check (#3021)
Browse files Browse the repository at this point in the history
This use of offset 'i' should follow the range check.
  • Loading branch information
szsam authored Apr 22, 2023
1 parent 5356806 commit 7b7c0c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/shapes/raygui.h
Original file line number Diff line number Diff line change
Expand Up @@ -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] == '#')
{
Expand Down

0 comments on commit 7b7c0c8

Please sign in to comment.