diff --git a/include/fmt/format.h b/include/fmt/format.h index 464c0d72..98c15c64 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -2501,7 +2501,7 @@ FMT_CONSTEXPR const Char* parse_align(const Char* begin, const Char* end, auto p = next_code_point(begin, end); if (p == end) p = begin; for (;;) { - switch (static_cast(*p)) { + switch (static_cast(*p)) { case '<': align = align::left; break; diff --git a/test/format-test.cc b/test/format-test.cc index 7841c68f..2d017a81 100644 --- a/test/format-test.cc +++ b/test/format-test.cc @@ -1525,6 +1525,7 @@ TEST(FormatterTest, WideFormatString) { EXPECT_EQ(L"4.2", format(L"{}", 4.2)); EXPECT_EQ(L"abc", format(L"{}", L"abc")); EXPECT_EQ(L"z", format(L"{}", L'z')); + EXPECT_THROW(fmt::format(L"{:*\x343E}", 42), fmt::format_error); } TEST(FormatterTest, FormatStringFromSpeedTest) {