summaryrefslogtreecommitdiff
path: root/src/format.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/format.cc')
-rw-r--r--src/format.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/format.cc b/src/format.cc
index b841af23..5b813ee6 100644
--- a/src/format.cc
+++ b/src/format.cc
@@ -286,7 +286,7 @@ string format_t::truncate(const unistring& ustr, std::size_t width,
assert(width < 4095);
const std::size_t len = ustr.length();
- if (len <= width)
+ if (width == 0 || len <= width)
return ustr.extract();
std::ostringstream buf;