Skip to content

Commit

Permalink
Add support for code units > 0xFFFF in fill
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaut committed Oct 20, 2024
1 parent 601be1c commit a16ff57
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion include/fmt/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,8 @@ FMT_CONSTEXPR void for_each_codepoint(string_view s, F f) {
auto num_chars_left = to_unsigned(s.data() + s.size() - p);
if (num_chars_left == 0) return;

FMT_ASSERT(num_chars_left < block_size, "");
// Suppress bogus -Wstringop-overflow.
if (FMT_GCC_VERSION) num_chars_left &= 3;
char buf[2 * block_size - 1] = {};
copy<char>(p, p + num_chars_left, buf);
const char* buf_ptr = buf;
Expand Down

0 comments on commit a16ff57

Please sign in to comment.