mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-23 15:50:49 +01:00
[apps] MathToolbox: fix scope of buffer used in handleEventWithText
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user