diff options
Diffstat (limited to 'compat')
| -rw-r--r-- | compat/format.hpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/compat/format.hpp b/compat/format.hpp index 741b35bd..d0736c97 100644 --- a/compat/format.hpp +++ b/compat/format.hpp @@ -4,7 +4,6 @@ #include <fmt/compile.h> #include <Corrade/Containers/StringView.h> #include <Corrade/Containers/String.h> -#include <Corrade/Utility/Math.h> #include <Corrade/Utility/Move.h> namespace fmt { @@ -54,11 +53,15 @@ 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>(fmt), Corrade::Utility::forward<Xs>(args)...); - const auto len = Utility::min(n, result.size); + const auto len = n < result.size ? n : result.size; fm_assert(len > 0); +#if 0 if constexpr(N > 0) buf[len] = '\0'; - return len; +#else + buf[len] = '\0'; +#endif + return result.size; } } // namespace floormat |
