Re: [Code] Strange error.

From: The Fungi (
Date: 01/10/03

On Sat, Jan 11, 2003 at 01:09:02AM +0100, Thomas Arp wrote:
> Putting in an assert() would be pointless, unless you're doing some
> manual additions beside the snprintf().

This was suggested more to catch misuse of string functions. I
don't do it personally, but it could be helpful in avoiding
accidental overflows where you forgot to sNprintf() and just used an
sprintf() call instead. Belt and suspenders.

> Making further structs is only necessary if you wish the buffer to
> be inherited into the functions below it, and only then if you don't
> wish to add a size_t argument to the function.

Again, mostly useful to keep sharp objects away from dangerous
developers when coupled with strict use of wrapper functions to add
to and read from checked_string instances, reducing the chances of a
less savvy coworker introducing arbitrary buffer overflows. It's
bloat, granted, and I wouldn't bother in code where I was the only
one touching things. Of course, you could argue that coders
frequently making these sorts of mistakes shouldn't be messing with
C in the first place (or any other language lacking real strings).

But you're right. Probably useless for the situation at hand...
{ IRL(Jeremy_Stanley); PGP(9E8DFF2E4F5995F8FEADDC5829ABF7441FB84657);
SMTP(; IRC(; ICQ(114362511);
AIM(dreadazathoth); YAHOO(crawlingchaoslabs); FINGER(;
MUD(; WWW(; }

   | FAQ: |
   | Archives: |
   | Newbie List:   |

This archive was generated by hypermail 2b30 : 06/26/03 PDT