[apps/calc] Replacing ans in the input may make the input unparsable

This commit is contained in:
Léa Saviot
2018-11-12 11:56:28 +01:00
committed by Émilie Feral
parent 61c1f6a7d4
commit 527c1d02ce

View File

@@ -103,6 +103,11 @@ bool App::textInputIsCorrect(const char * text) {
if (length >= Calculation::k_printedExpressionSize-1) {
return false;
}
exp = Expression::parse(buffer);
if (exp.isUninitialized()) {
// The ans replacement made the expression unparsable
return false;
}
return true;
}