mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-01-19 00:37:25 +01:00
Clean strlcpy arguments
This commit is contained in:
committed by
EmilieNumworks
parent
06999e8e2e
commit
5d92f13c26
@@ -274,11 +274,12 @@ void CalculationController::updateTitle() {
|
||||
int currentChar = 0;
|
||||
for (int index = 0; index < m_law->numberOfParameter(); index++) {
|
||||
m_titleBuffer[currentChar++] = I18n::translate(m_law->parameterNameAtIndex(index))[0];
|
||||
strlcpy(m_titleBuffer+currentChar, " = ", 4);
|
||||
strlcpy(m_titleBuffer+currentChar, " = ", k_maxNumberOfTitleCharacters);
|
||||
currentChar += 3;
|
||||
char buffer[PrintFloat::bufferSizeForFloatsWithPrecision(Constant::ShortNumberOfSignificantDigits)];
|
||||
const size_t bufferSize = PrintFloat::bufferSizeForFloatsWithPrecision(Constant::ShortNumberOfSignificantDigits);
|
||||
char buffer[bufferSize];
|
||||
PrintFloat::convertFloatToText<double>(m_law->parameterValueAtIndex(index), buffer, PrintFloat::bufferSizeForFloatsWithPrecision(Constant::ShortNumberOfSignificantDigits), Constant::ShortNumberOfSignificantDigits, Preferences::PrintFloatMode::Decimal);
|
||||
strlcpy(m_titleBuffer+currentChar, buffer, strlen(buffer)+1);
|
||||
strlcpy(m_titleBuffer+currentChar, buffer, bufferSize - currentChar);
|
||||
currentChar += strlen(buffer);
|
||||
m_titleBuffer[currentChar++] = ' ';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user