From cdfd5986f699e9333962db96a8b24d5b7ee6c748 Mon Sep 17 00:00:00 2001 From: Naffanya Date: Thu, 20 Mar 2014 01:12:09 +0200 Subject: [PATCH] Add send message to log about excess length of params --- projects/stargazer/plugins/other/rscript/rscript.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/projects/stargazer/plugins/other/rscript/rscript.cpp b/projects/stargazer/plugins/other/rscript/rscript.cpp index 17b86c67..4e454b5e 100644 --- a/projects/stargazer/plugins/other/rscript/rscript.cpp +++ b/projects/stargazer/plugins/other/rscript/rscript.cpp @@ -430,12 +430,15 @@ for(it = rsSettings.GetUserParams().begin(); ++it) { std::string parameter; - if (*it == "tariffName") + if (*it == "tariffName") parameter = rsu.user->GetParamValue("tariff"); - else + else parameter = rsu.user->GetParamValue(*it); if (params.length() + parameter.length() > RS_PARAMS_LEN - 1) + { + logger("Script params string length %i exceeds the limit of %i symbols.", params.length() + parameter.length(), RS_PARAMS_LEN); break; + } params += parameter + " "; } strncpy((char *)packetTail.params, params.c_str(), RS_PARAMS_LEN); -- 2.44.2