From c7e42d7f1a4d7bea93090c826e7cf5de19c3061b Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sun, 24 Jan 2010 18:16:29 -0800 Subject: * stream.c (vformat_num): Fix bad width calculation. --- ChangeLog | 4 ++++ stream.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 9871e1a4..695e17a6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2010-01-24 Kaz Kylheku + + * stream.c (vformat_num): Fix bad width calculation. + 2010-01-21 Kaz Kylheku Fix for unbounded memory growth problem reproduced with GCC 4.4.1 diff --git a/stream.c b/stream.c index 5f93209b..97934867 100644 --- a/stream.c +++ b/stream.c @@ -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; -- cgit v1.2.3