From 98c1f76f24997aa60950096ea5e098891569d1d5 Mon Sep 17 00:00:00 2001 From: vitaut Date: Sun, 6 Dec 2015 07:44:07 -0800 Subject: [PATCH] Replace uninitialized_copy with memmove (#242) because the memory areas may overlap. --- format.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/format.h b/format.h index b2c612a6..98190162 100644 --- a/format.h +++ b/format.h @@ -2773,7 +2773,7 @@ void BasicWriter::write_double( spec.width() > static_cast(n)) { width = spec.width(); CharPtr p = grow_buffer(width); - std::uninitialized_copy(p, p + n, p + (width - n) / 2); + std::memmove(p + (width - n) / 2, p, n * sizeof(Char)); fill_padding(p, spec.width(), n, fill); return; }