🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #831

Re: printf zero-pads strings?

#831
From: Wm E Davidsen Jr
Date: Mon, 23 Oct 1989 20:54
25 lines
1607 bytes
In article <11390@smoke.BRL.MIL>, gwyn@smoke.BRL.MIL (Doug Gwyn) writes:

|  >K&R2 and several other compilers give "    x", claiming that zero-padding
|  >applies only to numeric values.
|  
|  And that is what we intend.

  And broke every program which used zero fill for strings! I think you
also broke zero fill for left justified data, both strings and numerics.

  Before you write a hot reply, I'm joking. One of the hardest problems
I had to find (someone else's code) was a case where a number was
zerofill, left justified. Naturally we were looking for something in the
code which multiplied by ten every time the value dropped below 100! 

  I actually do have a program which uses zero filled strings and I
will not complain if it breaks, it was a hack and is documented as
such. The program was compiled on VMS2 (yes ten years ago) and has
probably never been recompiled.

-- 
bill davidsen	(davidsen@crdos1.crd.GE.COM -or- uunet!crdgw1!crdos1!davidsen)
"The world is filled with fools. They blindly follow their so-called
'reason' in the face of the church and common sense. Any fool can see
that the world is flat!" - anon
Technical Details
Message-ID: <1343@crdos1.crd.ge.COM>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!cs.utexas.edu!uunet!crdgw1!crdos1!davidsen
References: <7279@sdcsvax.UCSD.Edu> <11390@smoke.BRL.MIL>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wuarchive!cs.utexas.edu!uunet!crdgw1!crdos1!davidsen
From: davidsen@crdos1.crd.ge.COM (Wm E Davidsen Jr)
Newsgroups: comp.std.c
Subject: Re: printf zero-pads strings?
Message-ID: <1343@crdos1.crd.ge.COM>
Date: 23 Oct 89 20:54:33 GMT
References: <7279@sdcsvax.UCSD.Edu> <11390@smoke.BRL.MIL>
Reply-To: davidsen@crdos1.UUCP (bill davidsen)
Organization: GE Corp R&D Center
Lines: 25