From 3d9477ea58adda56187237a40c0118a559eb5cd5 Mon Sep 17 00:00:00 2001 From: Miran Date: Wed, 5 Feb 2025 08:29:44 +0100 Subject: [PATCH] Legacy behavior for INI read int/float when value does not contain any numbers. --- cleo_plugins/IniFiles/IniFiles.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cleo_plugins/IniFiles/IniFiles.cpp b/cleo_plugins/IniFiles/IniFiles.cpp index 4841c66f..cb7107fe 100644 --- a/cleo_plugins/IniFiles/IniFiles.cpp +++ b/cleo_plugins/IniFiles/IniFiles.cpp @@ -58,7 +58,8 @@ class IniFiles // parse char* end; int value = strtol(str, &end, base); - if (end != str) // at least one number character consumed + if (end != str || // at least one number character consumed + IsLegacyScript(thread)) // old CLEO reported success anyway with value 0 { OPCODE_WRITE_PARAM_INT(value); OPCODE_CONDITION_RESULT(true); @@ -130,7 +131,8 @@ class IniFiles value = strtof(str, &end); } - if (end != str) // at least one number character consumed + if (end != str || // at least one number character consumed + IsLegacyScript(thread)) // old CLEO reported success anyway with value 0 { OPCODE_WRITE_PARAM_FLOAT(value); OPCODE_CONDITION_RESULT(true);