Article View: comp.sources.bugs
Article #62Re: Bug in csh (history, "!a%100s"). Report and Fix.
From: Allyn Fratkin
Date: Sun, 09 Jul 1989 17:26
Date: Sun, 09 Jul 1989 17:26
25 lines
1400 bytes
1400 bytes
In article <769@sbsvax.UUCP>, greim@sbsvax.UUCP (Michael Greim) writes:
> This fix works like this:
> - in error only a string ending in "@" is passed as format string
> to printf.
> - only internal error messages needing arguments need format specifiers,
> so I add a trailing "@" to any such message
> - any string not ending with "@" is passed to printf with "%s" as first
> parameter.
nothing personal, but what a disgusting hack. you use @ as the *last*
character of the string to indicate the presence of a second parameter?
wouldn't it have been much easier to use the first char?
but why didn't you just change the calls
error(singlearg);
to
error("%s", singlearg);
seems like it would have been much cleaner.
(you could have done it with sed! but i won't get into that now :-) )
--
From the virtual mind of Allyn Fratkin allyn@sdd.hp.com
San Diego Division - or -
Hewlett-Packard Company uunet!ucsd!hp-sdd!allyn
Technical Details
Message-ID:
<2218@hp-sdd.hp.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!agate!ucbvax!hplabs!hp-sdd!allynReferences:
<769@sbsvax.UUCP>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!agate!ucbvax!hplabs!hp-sdd!allyn From: allyn@hp-sdd.hp.com (Allyn Fratkin) Newsgroups: comp.sources.bugs Subject: Re: Bug in csh (history, "!a%100s"). Report and Fix. Message-ID: <2218@hp-sdd.hp.com> Date: 9 Jul 89 17:26:11 GMT References: <769@sbsvax.UUCP> Sender: news@hp-sdd.hp.com Lines: 25