diff options
| author | augustss <augustss@NetBSD.org> | 2001-11-27 18:00:55 +0000 |
|---|---|---|
| committer | augustss <augustss@NetBSD.org> | 2001-11-27 18:00:55 +0000 |
| commit | a928006fbbfe9030fb869e314a4e5d2cee2e0992 (patch) | |
| tree | f4d2d254c32c1567c4eac989dfe03da914c9e711 /lib/libc/stdio/vfprintf.c | |
| parent | 3936fc474048d5c2ffaf4667e60c4a3d40fd48c1 (diff) | |
Print sign of -0.0 correctly. Fixes PR 3137 (mine).
Diffstat (limited to 'lib/libc/stdio/vfprintf.c')
| -rw-r--r-- | lib/libc/stdio/vfprintf.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/stdio/vfprintf.c b/lib/libc/stdio/vfprintf.c index b88f982f793..76460a7e004 100644 --- a/lib/libc/stdio/vfprintf.c +++ b/lib/libc/stdio/vfprintf.c @@ -1,4 +1,4 @@ -/* $NetBSD: vfprintf.c,v 1.37 2001/11/04 13:57:30 lukem Exp $ */ +/* $NetBSD: vfprintf.c,v 1.38 2001/11/27 18:00:55 augustss Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. @@ -41,7 +41,7 @@ #if 0 static char *sccsid = "@(#)vfprintf.c 5.50 (Berkeley) 12/16/92"; #else -__RCSID("$NetBSD: vfprintf.c,v 1.37 2001/11/04 13:57:30 lukem Exp $"); +__RCSID("$NetBSD: vfprintf.c,v 1.38 2001/11/27 18:00:55 augustss Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -812,7 +812,7 @@ cvt(value, ndigits, flags, sign, decpt, ch, length) mode = 2; /* ndigits significant digits */ } - if (value < 0) { + if (copysign(1.0, value) < 0) { /* Use copysign to handle -0.0 */ value = -value; *sign = '-'; } else |
