From 97888a35f3c1a4e84bb165bf2c4d086984d08798 Mon Sep 17 00:00:00 2001 From: Nick Gammon Date: Sun, 1 May 2011 15:22:07 +1000 Subject: [PATCH] Fixed error message in gen_inputbox --- scripting/lua_utils.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripting/lua_utils.cpp b/scripting/lua_utils.cpp index 8cbaffdc..4a3e1015 100644 --- a/scripting/lua_utils.cpp +++ b/scripting/lua_utils.cpp @@ -359,13 +359,13 @@ static int gen_inputbox (lua_State *L, T & msg) } // validate function there } // table of extra stuff there + + if (strlen (inputmsg) > 1000) + luaL_error (L, "inputbox message too long (max 1000 characters)"); // if we leave in & it will make the next letter underlined string sInputMsg = FindAndReplace (inputmsg, "&", "&&"); - if (sInputMsg.length () > 1000) - luaL_error (L, "inputbox message too long (max 1000 characters)"); - if (strlen (inputtitle) > 100) luaL_error (L, "inputbox title too long (max 100 characters)");