about summary refs log tree commit diff
path: root/stdio-common/printf_fp.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-12-06 20:58:25 +0000
committerUlrich Drepper <drepper@redhat.com>2000-12-06 20:58:25 +0000
commit23a5c823a00a3fe593813e556faccceaebfa3efe (patch)
tree3fa13bb2dcfde4df1ef670eb20a822317c63aa6b /stdio-common/printf_fp.c
parentd36c3615fc9bdec72ec35413daa3a9e7d4df778f (diff)
downloadglibc-23a5c823a00a3fe593813e556faccceaebfa3efe.tar.gz
glibc-23a5c823a00a3fe593813e556faccceaebfa3efe.tar.xz
glibc-23a5c823a00a3fe593813e556faccceaebfa3efe.zip
Update.
2000-12-06  Ulrich Drepper  <drepper@redhat.com>

	* stdio-common/printf_fp.c (__printf_fp): Handle decimal point in
	x.5 rounding correctly.
Diffstat (limited to 'stdio-common/printf_fp.c')
-rw-r--r--stdio-common/printf_fp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/stdio-common/printf_fp.c b/stdio-common/printf_fp.c
index 2147b2994d..0f598d87ef 100644
--- a/stdio-common/printf_fp.c
+++ b/stdio-common/printf_fp.c
@@ -923,7 +923,9 @@ __printf_fp (FILE *fp,
       {
 	wchar_t *wtp = wcp;
 
-	if (digit == L'5' && (*(wcp - 1) & 1) == 0)
+	if (digit == L'5'
+	    && ((*(wcp - 1) != decimalwc && (*(wcp - 1) & 1) == 0)
+		|| ((*(wcp - 1) == decimalwc && (*(wcp - 2) & 1) == 0))))
 	  {
 	    /* This is the critical case.	 */
 	    if (fracsize == 1 && frac[0] == 0)