From owner-freebsd-bugs Sat May 6 20:25:56 1995 Return-Path: bugs-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id UAA00548 for bugs-outgoing; Sat, 6 May 1995 20:25:56 -0700 Received: from irz301.inf.tu-dresden.de (irz301.inf.tu-dresden.de [141.76.1.11]) by freefall.cdrom.com (8.6.10/8.6.6) with SMTP id UAA00539 for ; Sat, 6 May 1995 20:25:43 -0700 Received: from sax.sax.de by irz301.inf.tu-dresden.de with SMTP (5.67b+/DEC-Ultrix/4.3) id AA10010; Sun, 7 May 1995 05:24:58 +0200 Received: by sax.sax.de (8.6.12/8.6.12-s1) with UUCP id FAA25546 for freebsd-bugs@FreeBSD.org; Sun, 7 May 1995 05:24:58 +0200 Received: (from j@localhost) by uriah.heep.sax.de (8.6.11/8.6.9) id FAA06928 for freebsd-bugs@FreeBSD.org; Sun, 7 May 1995 05:24:09 +0200 From: J Wunsch Message-Id: <199505070324.FAA06928@uriah.heep.sax.de> Subject: Re: bin/386: *s field width specification doesn't seem to work for printf To: freebsd-bugs@FreeBSD.org (FreeBSD bugs list) Date: Sun, 7 May 1995 05:24:09 +0200 (MET DST) Reply-To: freebsd-bugs@FreeBSD.org (FreeBSD bugs list) In-Reply-To: <199505070209.TAA11643@gndrsh.aac.dev.com> from "Rodney W. Grimes" at May 6, 95 07:09:13 pm Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch) X-Phone: +49-351-2012 669 X-Mailer: ELM [version 2.4 PL23] Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Content-Length: 1060 Sender: bugs-owner@FreeBSD.org Precedence: bulk As Rodney W. Grimes wrote: > > > Try this: printf "%8*s" foobarblatt > You are missing the required int arg for the * and foobarblatt is being > used for this int. foobarblatt is probably some rather very large int > value and appears to loop forever, when infact it is outputing tons and > tons of spaces to bad the width of the field. > > Please close this bug report as programmer error.... Rod, did you actually try it? "foobarblatt" ain't a valid int. printf(1) misses an argument in that case. It expected two args (for the * and for the s) and got only one. The least one could expect is it loudly complains about this. Furthermore, if you omit the asterisk, you'll be surprised that you can still see a very nice "foobarblatt" instead of the expected "foobarbl". You can also replace the command by printf "%*s" 8 foobarblatt to the same avail. Seems there's more than just one bug... :-( -- cheers, J"org joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ Never trust an operating system you don't have sources for. ;-)