Skip to content

Commit

Permalink
Fix handling of wide alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaut committed Sep 15, 2020
1 parent f80ed64 commit 5b5a597
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion include/fmt/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<char>(*p)) {
switch (static_cast<int>(*p)) {
case '<':
align = align::left;
break;
Expand Down
1 change: 1 addition & 0 deletions test/format-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 5b5a597

Please sign in to comment.