--Multipart_Tue_Sep_10_10:17:08_2002-1
Content-Type: text/plain; charset=US-ASCII
printf("%+f", -0.0) prints "+0.0000000" if missing/vsnprintf.c is used.
Could you anyone test this patch and commit? I don't know what platforms
need this code.
This bug was found in FreeBSD. OpenBSD and MacOS X have too.
http://www.freebsd.org/cgi/query-pr.cgi?prA823
-- Gotoken
--Multipart_Tue_Sep_10_10:17:08_2002-1
Content-Type: application/octet-stream; type=patch
Content-Disposition: attachment; filename="vsnprintf.c.diff"
Content-Transfer-Encoding: 7bit
Index: vsnprintf.c
RCS file: /home/ruby/cvs/src/ruby/missing/vsnprintf.c,v
retrieving revision 1.7
diff -u -r1.7 vsnprintf.c
--- vsnprintf.c 6 Sep 2002 08:59:41 -0000 1.7
+++ vsnprintf.c 10 Sep 2002 00:57:35 -0000
@@ -1015,15 +1015,8 @@
else {
mode ;
}
- if (value < 0) {
- value value;
- *sign -';
- } else if (value 0.0 && 1.0/value < 0) {
- *sign -';
- } else {
- *sign \000';
- }
digits SD__dtoa(value, mode, ndigits, decpt, &dsgn, &rve);
+ *sign sgn ! ;
if (flags & ALT) { /* Print trailing zeros */
bp igits + ndigits;
if (ch 'f') {
--Multipart_Tue_Sep_10_10:17:08_2002-1--