From 0f3eaeac0a3119820db2a62716ed5bb09a131c71 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Thu, 4 Jun 2020 06:33:11 -0700 Subject: [PATCH] Fix a warning --- include/fmt/format-inl.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/fmt/format-inl.h b/include/fmt/format-inl.h index f25b3767..3bddb8eb 100644 --- a/include/fmt/format-inl.h +++ b/include/fmt/format-inl.h @@ -584,9 +584,10 @@ class bigint { void operator=(const bigint&) = delete; void assign(const bigint& other) { - bigits_.resize(other.bigits_.size()); + auto size = other.bigits_.size(); + bigits_.resize(size); auto data = other.bigits_.data(); - std::copy(data, data + other.bigits_.size(), bigits_.data()); + std::copy(data, data + size, make_checked(bigits_.data(), size)); exp_ = other.exp_; }