Bug in csh (history, "!a%100s"). Report and Fix. Apology.

Michael Greim greim at sbsvax.UUCP
Mon Jul 10 21:46:47 AEST 1989


In article <114074 at sun.Eng.Sun.COM>, argv%eureka at Sun.COM (Dan Heller) writes:
= In article <771 at sbsvax.UUCP> greim at sbsvax.UUCP (Michael Greim) writes:
= > In article <113630 at sun.Eng.Sun.COM>, argv%eureka at Sun.COM (Dan Heller) writes:
= > > Why are people so stuck on using printf?  Michael Greim finds a bug
= 
= Basically, I apologize for the "flame" that people seem to think I
= posted.  I wasn't flaming really.  I just meant to point out that
= puts() will never be slower than printf(), so to avoid "other bugs"
= (see below), it's safer to use puts when that's what you really meant.
= Sorry, Michael.

No offense taken.
As to "puts() will never be slower than printf()": I recall reading
somewhere that some people think about implementing puts() using printf().

= 
= No, I was talking about the type of bug that lint can't catch.  That is,
= I see this type of usage all the time:
= 
=     ...
=     send_to_file("this is a string");
=     ...
= 
= send_to_file(s)
= char *s;
= {
=     extern FILE *fp;
=     fprintf(fp, s);
= }
You must look at some strange progams :-)

I aggree that this is bad practice and people should be made aware of
it.

	-mg
-- 
Michael Greim    Email : greim at sbsvax.informatik.uni-saarland.dbp.de
                 or    : ...!uunet!unido!sbsvax!greim
[.signature removed by the board of censors for electronic mail's main
executive computer because it contained a four letter word ("word")]



More information about the Comp.sources.bugs mailing list