From owner-freebsd-bugs Fri Nov 3 01:10:05 1995 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id BAA00224 for bugs-outgoing; Fri, 3 Nov 1995 01:10:05 -0800 Received: (from gnats@localhost) by freefall.freebsd.org (8.6.12/8.6.6) id BAA00216 ; Fri, 3 Nov 1995 01:10:02 -0800 Date: Fri, 3 Nov 1995 01:10:02 -0800 Message-Id: <199511030910.BAA00216@freefall.freebsd.org> To: freebsd-bugs Cc: From: Bruce Evans Subject: Re: bin/809: printf goroup bug [`.' optional precision] Reply-To: Bruce Evans Sender: owner-bugs@FreeBSD.org Precedence: bulk The following reply was made to PR bin/809; it has been noted by GNATS. From: Bruce Evans To: FreeBSD-gnats-submit@freebsd.org, kato@eclogite.eps.nagoya-u.ac.jp Cc: Subject: Re: bin/809: printf goroup bug [`.' optional precision] Date: Fri, 3 Nov 1995 20:02:56 +1100 >#include >void main(void) >{ > printf("%.2d\n", 1); > printf("%+.2d\n", 1); > printf("%+.3d\n", 1); >} >gives following result: >01 >+1 >+01 Signs and other prefixes reduce the precision in all cases that I looked at: printf("%.3d\n", -1); printf("%.3d\n", 1); printf("%+.3d\n", -1); printf("%+.3d\n", 1); printf("% .3d\n", -1); printf("% .3d\n", 1); printf("%#.3x\n", 1); gives the follow result: -01 001 -01 +01 -01 01 0x1 Bruce