diff --git a/apps/math_toolbox.cpp b/apps/math_toolbox.cpp index 3c6512eae..a87b8ef53 100644 --- a/apps/math_toolbox.cpp +++ b/apps/math_toolbox.cpp @@ -117,15 +117,14 @@ bool MathToolbox::selectLeaf(int selectedRow) { // Translate the message const char * text = I18n::translate(messageTree->insertedText()); + char textToInsert[k_maxMessageSize]; // Has to be in the same scope as handleEventWithText if (messageTree->label() == messageTree->insertedText()) { // Remove the arguments if we kept one message for both inserted and displayed message int maxTextToInsertLength = strlen(text) + 1; assert(maxTextToInsertLength <= k_maxMessageSize); - char textToInsert[k_maxMessageSize]; Shared::ToolboxHelpers::TextToInsertForCommandText(text, textToInsert, maxTextToInsertLength, true); text = textToInsert; } - sender()->handleEventWithText(text); app()->dismissModalViewController(); return true;