From b8627a7d786d53e42dbad87a9eef87589dff0d16 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 4 Nov 2023 23:42:19 +0100 Subject: ccc --- compat/format.hpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compat/format.hpp b/compat/format.hpp index 9a61dd96..741b35bd 100644 --- a/compat/format.hpp +++ b/compat/format.hpp @@ -1,4 +1,5 @@ #pragma once +#include "compat/assert.hpp" #include #include #include @@ -54,6 +55,7 @@ size_t snformat(char(&buf)[N], Fmt&& fmt, Xs&&... args) constexpr size_t n = N > 0 ? N - 1 : 0; auto result = fmt::format_to_n(buf, n, Corrade::Utility::forward(fmt), Corrade::Utility::forward(args)...); const auto len = Utility::min(n, result.size); + fm_assert(len > 0); if constexpr(N > 0) buf[len] = '\0'; return len; -- cgit v1.2.3