Vanilla List Maling List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [VANILLA-LIST:2200] Ouch



On Thu, Mar 25, 1999 at 03:05:43PM -0600, Bob Tanner wrote:
> 
> Well, I thought the hand coded string utils would be just as good of a
> solution as snprintf().

But then again, I'm not that big of a fan of snprintf, either.  It's BPP
to throw around arbitrary sized strings and rely on snprintf or other
system calls to catch your mistakes.  It's certainly appropriate in
a few critical cases (such as copying to/from network packet), but
the bottom line is that if an overrun would have occured without snprintf,
it is a bug in the code and should be fixed.

Either that or support full dynamic sized strings (much better behavior).

-- 
Dave Ahn <ahn@vec.wfubmc.edu>        |  "When you were born, you cried and the
                                     |  world rejoiced.  Try to live your life
Virtual Endoscopy Center             |  so that when you die, you will rejoice
Wake Forest Univ. School of Medicine |  and the world will cry."  -1/2 jj^2