On Fri, Apr 10, 2009 at 07:13:21AM +0900, YONETANI Tomokazu wrote:
> 
> After upgrading to recent HEAD (with standard buildworld and buildkernel),
> I'm seeing two problems:
> - df(1) produces weird output on a partition:
>   Filesystem  1K-blocks Used  Avail Capacity  Mounted on
>   /dev/ad0s1h   1032142 2242 947330    0.%    /tmp
> 

Can you try the attached patch please?  It's a hack, but I'm working on
some other changes to stdio stuff that will be more complete.

--Peter
diff --git a/lib/libc/stdio/vfprintf.c b/lib/libc/stdio/vfprintf.c
index f8ba337..29b913f 100644
--- a/lib/libc/stdio/vfprintf.c
+++ b/lib/libc/stdio/vfprintf.c
@@ -1546,7 +1546,7 @@ cvt(double value, int ndigits, int flags, char *sign, int 
*decpt,
                /* print trailing zeros */
                bp = digits + ndigits;
                if (ch == 'f') {
-                       if (*digits == '0' && value)
+                       if ((*digits == '0' || *digits == '\0') && value)
                                *decpt = -ndigits + 1;
                        bp += *decpt;
                }

Attachment: pgpQgDMGHFfLJ.pgp
Description: PGP signature

Reply via email to