From ed68a34530175ec04d6542df97b584c68e86bf1c Mon Sep 17 00:00:00 2001 From: fen fox <4973633+FenTheFox@users.noreply.github.com> Date: Tue, 8 Aug 2023 20:06:54 -0400 Subject: [PATCH] fix crash when script line only consists of a single space --- ONScripter_text.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ONScripter_text.cpp b/ONScripter_text.cpp index 15c15f8..72224cd 100644 --- a/ONScripter_text.cpp +++ b/ONScripter_text.cpp @@ -1472,6 +1472,8 @@ int ONScripter::textCommand() // now get the first two words in the script char *current_word = strtok(temp_text, " "); char *next_word = strtok(NULL, " "); + if (current_word == NULL) + current_word = ""; // check for padding spaces in the first word if(¤t_word[0] != &temp_text[0])