From e53051a3490c0c2adba232b4fa5c9e96143b2a16 Mon Sep 17 00:00:00 2001 From: Oleg Kalachev Date: Wed, 13 May 2026 06:00:51 +0300 Subject: [PATCH] Fix console command parsing --- flix/util.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/flix/util.h b/flix/util.h index ffb57b3..cda50f3 100644 --- a/flix/util.h +++ b/flix/util.h @@ -36,11 +36,14 @@ float wrapAngle(float angle) { // Trim and split string by spaces void splitString(String& str, String& token0, String& token1, String& token2) { str.trim(); + if (str.isEmpty()) return; char chars[str.length() + 1]; str.toCharArray(chars, str.length() + 1); token0 = strtok(chars, " "); - token1 = strtok(NULL, " "); // String(NULL) creates empty string + token1 = strtok(NULL, " "); token2 = strtok(NULL, ""); + if (token1.c_str() == NULL) token1 = ""; + if (token2.c_str() == NULL) token2 = ""; } // Rate limiter