diff options
author | sin-ack <sin-ack@users.noreply.github.com> | 2022-07-11 17:40:07 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-07-12 23:11:35 +0200 |
commit | 52d017c61121dd6fcfbf31c274a83da126271252 (patch) | |
tree | 2e69a5518e22cbd6e9a16008c5dcf67caec9c9b7 | |
parent | 477191718427fe6af3b3ea771e94409d5526d390 (diff) | |
download | serenity-52d017c61121dd6fcfbf31c274a83da126271252.zip |
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. :^)
-rw-r--r-- | AK/CheckedFormatString.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/AK/CheckedFormatString.h b/AK/CheckedFormatString.h index d0dc4e81e8..1adb3eda7c 100644 --- a/AK/CheckedFormatString.h +++ b/AK/CheckedFormatString.h @@ -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); |