diff lib/vasnprintf.c @ 5066:a2cb70e482fc

Fix for format strings like "%2.f".
author Bruno Haible <bruno@clisp.org>
date Mon, 17 May 2004 11:27:08 +0000
parents e4317f1f2e2c
children dfed7854bcf3
line wrap: on
line diff
--- 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);
 			}
 		    }