From 00d1eb2bd04a3dd0b91438a25066db517cc7d1c9 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 4 Feb 2024 11:20:11 +0100 Subject: [PATCH] Update rtext.c (#3777) --- src/rtext.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/rtext.c b/src/rtext.c index 6163a92a985a..c6187a0a71d7 100644 --- a/src/rtext.c +++ b/src/rtext.c @@ -1471,13 +1471,14 @@ float TextToFloat(const char *text) text++; } - for (int i = 0; ((text[i] >= '0') && (text[i] <= '9')); i++) value = value*10.0f + (float)(text[i] - '0'); + int i = 0; + for (; ((text[i] >= '0') && (text[i] <= '9')); i++) value = value*10.0f + (float)(text[i] - '0'); if (text[i++] != '.') value *= sign; else { float divisor = 10.0f; - for (int i = 0; ((text[i] >= '0') && (text[i] <= '9')); i++) + for (; ((text[i] >= '0') && (text[i] <= '9')); i++) { value += ((float)(text[i] - '0'))/divisor; divisor = divisor*10.0f;