[apps] Move assert to where it matters

This commit is contained in:
Ruben Dashyan
2019-09-20 16:37:13 +02:00
committed by LeaNumworks
parent 312a19e760
commit d476e7944d
2 changed files with 1 additions and 1 deletions

View File

@@ -26,7 +26,6 @@ public:
constexpr static int k_parenthesedThetaArgumentByteLength = 4;
constexpr static int k_parenthesedXNTArgumentByteLength = 3;
constexpr static int k_maxNameWithArgumentSize = Poincare::SymbolAbstract::k_maxNameSize + k_parenthesedThetaArgumentByteLength; /* Function name and null-terminating char + "(θ)" */;
static_assert(k_maxNameWithArgumentSize > Poincare::SymbolAbstract::k_maxNameSize, "Forgot argument's size?");
static bool BaseNameCompliant(const char * baseName, NameNotCompliantError * error = nullptr);
// Constructors

View File

@@ -103,6 +103,7 @@ void VariableBoxController::willDisplayCellForIndex(HighlightCell * cell, int in
char symbolName[Shared::Function::k_maxNameWithArgumentSize];
size_t symbolLength = 0;
if (m_currentPage == Page::Expression) {
static_assert(Shared::Function::k_maxNameWithArgumentSize > Poincare::SymbolAbstract::k_maxNameSize, "Forgot argument's size?");
symbolLength = SymbolAbstract::TruncateExtension(symbolName, record.fullName(), SymbolAbstract::k_maxNameSize);
} else {
assert(m_currentPage == Page::Function);