diff --git a/include/fmt/format.h b/include/fmt/format.h index 7bd6543c3f78..751e19ad1707 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -566,7 +566,7 @@ template void buffer::append(const U* begin, const U* end) { size_t new_size = size_ + to_unsigned(end - begin); reserve(new_size); - std::uninitialized_copy(begin, end, make_checked(ptr_, capacity_) + size_); + std::uninitialized_copy(begin, end, make_checked(ptr_ + size_, capacity_ - size_)); size_ = new_size; } } // namespace detail