summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/format.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/format.cc b/src/format.cc
index 35f3d80f..ea38c861 100644
--- a/src/format.cc
+++ b/src/format.cc
@@ -368,8 +368,9 @@ void format_t::format(std::ostream& out_str, scope_t& scope)
result = truncate(temp, elem->max_width);
} else {
result = temp.extract();
- for (std::size_t i = 0; i < elem->min_width - temp.length(); i++)
- result += " ";
+ if (elem->min_width > temp.length())
+ for (std::size_t i = 0; i < elem->min_width - temp.length(); i++)
+ result += " ";
}
out_str << result;
} else {