From 19f781780e2d8e6779b2ff72d1f29e4df7116115 Mon Sep 17 00:00:00 2001 From: Ray Date: Tue, 7 Mar 2023 23:16:06 +0100 Subject: [PATCH] Update raygui.h --- src/raygui.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/raygui.h b/src/raygui.h index f9acaee..4f835b4 100644 --- a/src/raygui.h +++ b/src/raygui.h @@ -2486,7 +2486,7 @@ bool GuiTextBoxMulti(Rectangle bounds, char *text, int textSize, bool editMode) //int lastSpaceWidth = 0; //int lastSpaceCursorPos = 0; - for (int i = 0, codepointSize = 0; text[i] != '\0'; i += codepointSize) + for (int i = 0, codepointSize = 0; (text != NULL) && (text[i] != '\0'); i += codepointSize) { int codepoint = GetCodepointNext(text + i, &codepointSize); int index = GetGlyphIndex(guiFont, codepoint); // If requested codepoint is not found, we get '?' (0x3f)