# HG changeset patch # User Bruno Haible # Date 1084793228 0 # Node ID a2cb70e482fc0e97464520d4bd227a1885316a99 # Parent 4ce8ff7e5f063be240e60879a113165a436b3139 Fix for format strings like "%2.f". diff --git a/lib/ChangeLog b/lib/ChangeLog --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,9 @@ +2004-05-14 Bruno Haible + + * vasnprintf.c (VASNPRINTF): Correctly handle the case of a precision + that consists of a '.' followed by an empty digit string. + Patch by Tor Lillqvist . + 2004-05-17 Paul Eggert Port obstack to the AS/400, where pointers are 16 bytes wide and diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c --- a/lib/vasnprintf.c +++ b/lib/vasnprintf.c @@ -1,5 +1,5 @@ /* vsprintf with automatic memory allocation. - Copyright (C) 1999, 2002-2003 Free Software Foundation, Inc. + Copyright (C) 1999, 2002-2004 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -315,9 +315,8 @@ const CHAR_T *digitp = dp->precision_start + 1; precision = 0; - do + while (digitp != dp->precision_end) precision = xsum (xtimes (precision, 10), *digitp++ - '0'); - while (digitp != dp->precision_end); } }