From 100149eb587258f8b9da075ca6b7263b541fe12d Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Mon, 24 Dec 2012 11:41:20 -0800 Subject: [PATCH] Fix compilation on pre C++11. --- format.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/format.cc b/format.cc index 37b73ed7..12c8ea00 100644 --- a/format.cc +++ b/format.cc @@ -312,10 +312,12 @@ void Formatter::FormatString( char *out = 0; if (spec.width > size) { out = GrowBuffer(spec.width); - if (spec.align == ALIGN_RIGHT) - out = std::fill_n(out, spec.width - size, spec.fill); - else + if (spec.align == ALIGN_RIGHT) { + std::fill_n(out, spec.width - size, spec.fill); + out += spec.width - size; + } else { std::fill_n(out + size, spec.width - size, spec.fill); + } } else { out = GrowBuffer(size); }