From owner-freebsd-current@FreeBSD.ORG Sun Apr 6 07:45:06 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7158E37B401 for ; Sun, 6 Apr 2003 07:45:06 -0700 (PDT) Received: from gluon.dyndns.org (s225.dhcp212-198-162.noos.fr [212.198.162.225]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4044D43F85 for ; Sun, 6 Apr 2003 07:45:05 -0700 (PDT) (envelope-from chris@gluon.dyndns.org) Received: from gluon.dyndns.org (localhost [127.0.0.1]) by gluon.dyndns.org (8.12.9/8.12.9) with ESMTP id h36Ej16I058436 for ; Sun, 6 Apr 2003 16:45:02 +0200 (CEST) (envelope-from chris@gluon.dyndns.org) Received: (from chris@localhost) by gluon.dyndns.org (8.12.9/8.12.9/Submit) id h36Ej1Gx058435 for current@freebsd.org; Sun, 6 Apr 2003 16:45:01 +0200 (CEST) Date: Sun, 6 Apr 2003 16:45:01 +0200 From: Christophe Juniet To: current@freebsd.org Message-ID: <20030406144500.GA58090@gluon.dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.1i Subject: Bug in gdtoa ? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Apr 2003 14:45:06 -0000 Hello, When using 'ls -lh', I noticed a strange behavior: all file sizes ending with one or more 0 are printed incorrectly. For instance: % ls -l .Xauthority -rw------- 1 chris chris 110 Apr 6 14:38 .Xauthority % ls -lh .Xauthority -rw------- 1 chris chris 1100B Apr 6 14:38 .Xauthority While I was looking into printsize() of src/bin/ls/print.c, I made this simple test: ---8<--- #include int main(void) { printf("%.1f\n", 1.0); printf("%.1f\n", 10.0); printf("%.1f\n", 100.0); printf("%.1f\n", 1000.0); printf("%.1f\n", 10000.0); printf("%.1f\n", 1.0); printf("%.1f\n", 11.0); printf("%.1f\n", 101.0); printf("%.1f\n", 1001.0); printf("%.1f\n", 10001.0); return 0; } ---8<--- Which output is: % cc -o test test.c % ./test 1.0 10.00 100.000 1000.0000 10000.00000 1.0 11.0 101.0 1001.0 10001.0 I suspect a bug in gdtoa since I get the correct output with 5.0-RELEASE. I cvsup'ed up src-all and now I'm running: FreeBSD gluon.dyndns.org 5.0-CURRENT FreeBSD 5.0-CURRENT #0: Sun Apr 6 14:15:10 CEST 2003 root@gluon.dyndns.org:/usr/obj/usr/src/sys/GLUON i386 If I got something wrong, how do I fix this ? Thanks, chris