diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | stream.c | 2 |
2 files changed, 5 insertions, 1 deletions
@@ -1,3 +1,7 @@ +2010-01-24 Kaz Kylheku <kkylheku@gmail.com> + + * stream.c (vformat_num): Fix bad width calculation. + 2010-01-21 Kaz Kylheku <kkylheku@gmail.com> Fix for unbounded memory growth problem reproduced with GCC 4.4.1 @@ -651,7 +651,7 @@ static val vformat_num(val stream, const char *str, int width, int left, int pad, int precision) { int len = strlen(str); - int truewidth = (width < precision) ? width : precision; + int truewidth = (width > precision) ? width : precision; int slack = (len < truewidth) ? truewidth - len : 0; int padlen = (len < precision) ? precision - len : 0; int i; |