From 52d017c61121dd6fcfbf31c274a83da126271252 Mon Sep 17 00:00:00 2001 From: sin-ack Date: Mon, 11 Jul 2022 17:40:07 +0000 Subject: [PATCH] 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. :^) --- AK/CheckedFormatString.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AK/CheckedFormatString.h b/AK/CheckedFormatString.h index d0dc4e81e84..1adb3eda7cc 100644 --- a/AK/CheckedFormatString.h +++ b/AK/CheckedFormatString.h @@ -147,7 +147,7 @@ template struct CheckedFormatString { template consteval CheckedFormatString(char const (&fmt)[N]) - : m_string { fmt } + : m_string { fmt, N - 1 } { #ifdef ENABLE_COMPILETIME_FORMAT_CHECK check_format_parameter_consistency(fmt);