From f0ab112c348755e6e79a3c5571eca03f2d5fddd8 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Sat, 24 Dec 2022 09:40:35 -0800 Subject: [PATCH] Cleanup parsing --- include/fmt/core.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/fmt/core.h b/include/fmt/core.h index e295d367..21fe1d76 100644 --- a/include/fmt/core.h +++ b/include/fmt/core.h @@ -2107,7 +2107,7 @@ template struct fill_t { public: FMT_CONSTEXPR void operator=(basic_string_view s) { auto size = s.size(); - if (size > max_size) return throw_format_error("invalid fill"); + FMT_ASSERT(size <= max_size, "invalid fill"); for (size_t i = 0; i < size; ++i) data_[i] = s[i]; size_ = static_cast(size); } @@ -2237,7 +2237,7 @@ template class specs_setter { FMT_CONSTEXPR void on_localized() { specs_.localized = true; } FMT_CONSTEXPR void on_zero() { - // If the 0 character and an align option both appear, the 0 character is ignored. + // Ignore 0 if align is specified for compatibility with std::format. if (specs_.align != align::none) return; specs_.align = align::numeric; specs_.fill[0] = Char('0');