Fix usage of temporary string (#185)

This commit is contained in:
Michał Janiszewski 2019-03-08 07:10:20 +01:00 committed by Brett Waldbaum
parent c325cb1b3a
commit c6b770eec8

View File

@ -488,7 +488,7 @@ void StandardCalculatorViewModel::HandleUpdatedOperandData(Command cmdenum)
m_selectedExpressionLastData = L""; m_selectedExpressionLastData = L"";
if (ch == 'x') if (ch == 'x')
{ {
temp = L'\0'; temp[0] = L'\0';
commandIndex = 0; commandIndex = 0;
} }
else else
@ -505,7 +505,7 @@ void StandardCalculatorViewModel::HandleUpdatedOperandData(Command cmdenum)
{ {
if (commandIndex == 0) if (commandIndex == 0)
{ {
delete temp; delete [] temp;
return; return;
} }