From 2c307e2839183f167863ea66b5183d46b26e2240 Mon Sep 17 00:00:00 2001 From: Murat Toprak Date: Thu, 31 Jul 2025 23:28:17 +0300 Subject: [PATCH] fix resizing error in allocator_move_impl --- include/fmt/format.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index 9bf35a31..16ac40c4 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -853,10 +853,8 @@ class basic_memory_buffer : public detail::buffer { if (alloc_ != other.alloc_ && data != other.store_) { size_t size = other.size(), capacity = other.capacity(); // Perform copy operation, allocators are different - this->reserve(size); - detail::copy(data, data + size, this->data()); this->resize(size); - other.clear(); + detail::copy(data, data + size, this->data()); return false; } return true;