Skip to content

Commit

Permalink
Replace uninitialized_copy with memmove (#242)
Browse files Browse the repository at this point in the history
because the memory areas may overlap.
  • Loading branch information
vitaut committed Dec 6, 2015
1 parent e7f4566 commit 98c1f76
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion format.h
Original file line number Diff line number Diff line change
Expand Up @@ -2773,7 +2773,7 @@ void BasicWriter<Char>::write_double(
spec.width() > static_cast<unsigned>(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;
}
Expand Down

0 comments on commit 98c1f76

Please sign in to comment.