AK: Make CheckedFormatString pass the char array size to StringView

This makes the assumption that we never pass a stack-allocated char
array to CheckedFormatString arguments (dbgln, outln, warnln). This
assumption seems to hold true for the current state of Serenity code, at
least. :^)
This commit is contained in:
sin-ack 2022-07-11 17:40:07 +00:00 committed by Andreas Kling
parent 4771917184
commit 52d017c611
Notes: sideshowbarker 2024-07-17 09:28:11 +09:00

View File

@ -147,7 +147,7 @@ template<typename... Args>
struct CheckedFormatString {
template<size_t N>
consteval CheckedFormatString(char const (&fmt)[N])
: m_string { fmt }
: m_string { fmt, N - 1 }
{
#ifdef ENABLE_COMPILETIME_FORMAT_CHECK
check_format_parameter_consistency<N, sizeof...(Args)>(fmt);