[apps/sequence] Fix bug: buffer size (overwriting on wrong memory space)

Change-Id: Icba06ed39c600a3a7a5c51caba0a3b9d5b1bce58
This commit is contained in:
Émilie Feral
2017-04-27 10:46:36 +02:00
parent 01d98a9a68
commit ffcc6b50a8

View File

@@ -238,7 +238,7 @@ void TermSumController::ContentView::LegendView::setSumSuperscript(float start,
const char sigma[2] = {Ion::Charset::CapitalSigma, 0};
char bufferStart[Complex::bufferSizeForFloatsWithPrecision(Constant::LargeNumberOfSignificantDigits)];
Complex::convertFloatToText(start, bufferStart, Complex::bufferSizeForFloatsWithPrecision(Constant::LargeNumberOfSignificantDigits), Constant::LargeNumberOfSignificantDigits, Expression::FloatDisplayMode::Decimal);
char bufferEnd[Complex::bufferSizeForFloatsWithPrecision(1)];
char bufferEnd[Complex::bufferSizeForFloatsWithPrecision(Constant::LargeNumberOfSignificantDigits)];
Complex::convertFloatToText(end, bufferEnd, Complex::bufferSizeForFloatsWithPrecision(Constant::LargeNumberOfSignificantDigits), Constant::LargeNumberOfSignificantDigits, Expression::FloatDisplayMode::Decimal);
m_sumLayout = new CondensedSumLayout(new StringLayout(sigma, 1), new StringLayout(bufferStart, strlen(bufferStart), KDText::FontSize::Small), new StringLayout(bufferEnd, strlen(bufferEnd), KDText::FontSize::Small));
m_sum.setExpression(m_sumLayout);