From 26d2ae628143b2da1982dcbfb5a502f32bcd7079 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Mon, 24 Dec 2012 11:58:49 -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 12c8ea00..536d79d2 100644 --- a/format.cc +++ b/format.cc @@ -517,10 +517,12 @@ void Formatter::DoFormat() { char *out = 0; if (spec.width > 1) { out = GrowBuffer(spec.width); - if (spec.align == ALIGN_RIGHT) - out = std::fill_n(out, spec.width - 1, spec.fill); - else + if (spec.align == ALIGN_RIGHT) { + std::fill_n(out, spec.width - 1, spec.fill); + out += spec.width - 1; + } else { std::fill_n(out + 1, spec.width - 1, spec.fill); + } } else { out = GrowBuffer(1); }