From 5d0b158f4c7b7fa506a9accec511209f68890982 Mon Sep 17 00:00:00 2001 From: Pádraig Brady Date: Sat, 14 Feb 2009 17:20:37 +0000 Subject: seq: Fix equal width calculation when '.' added to last number MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Issue reported by Samuel Hapák. * src/seq.c: Account for '.' added to "last" number. * tests/misc/seq: Add corresponding test. * NEWS: Mention the fix. --- src/seq.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/seq.c b/src/seq.c index 5f9da963b..ecc72f082 100644 --- a/src/seq.c +++ b/src/seq.c @@ -317,6 +317,8 @@ get_default_format (operand first, operand step, operand last) size_t last_width = last.width + (prec - last.precision); if (last.precision && prec == 0) last_width--; /* don't include space for '.' */ + if (last.precision == 0 && prec) + last_width++; /* include space for '.' */ size_t width = MAX (first_width, last_width); if (width <= INT_MAX) { -- cgit v1.2.3-70-g09d2