mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 07:37:35 +00:00
AK+Kernel+Userland: Enable some more compiletime format string checks
This enables format string checks for three more functions: - String::formatted() - Builder::appendff() - KBufferBuilder::appendff()
This commit is contained in:
parent
c989e55195
commit
7c2754c3a6
6 changed files with 24 additions and 17 deletions
|
@ -164,8 +164,11 @@ String Keypad::to_string() const
|
|||
builder.append("-");
|
||||
builder.appendff("{}", m_int_value);
|
||||
|
||||
if (m_frac_length > 0)
|
||||
builder.appendff(".{:0{}}", m_frac_value, m_frac_length);
|
||||
if (m_frac_length > 0) {
|
||||
// FIXME: This disables the compiletime format string check since we can't parse '}}' here correctly.
|
||||
// remove the 'StringView { }' when that's fixed.
|
||||
builder.appendff(StringView { ".{:0{}}" }, m_frac_value, m_frac_length);
|
||||
}
|
||||
|
||||
return builder.to_string();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue