On Sun, Mar 14, 2010 at 02:04:55PM +0100, Tamas TEVESZ wrote: > point taken, case closed, strn* then. With Mr. Drepper's help recent gcc/glibc have better boundary checking mechanisms, both compile- and run-time (-D_FORTIFY_SOURCE and -fstack-protector). C/C++ is a crappy language and if you want to use "strings" you are doomed to suffer for the rest of your life.
strl*() functions hides errors and you'll never know that something bad is happening. With strn*() you still can detect possible buffer overflows. *snprintf() functions are better because they return required buffer length. *asprintf() is even better, but you have to free allocated memory when you don't need this buffer any more and it's not portable. Point is - if you still have to suffer, try to do it in The Right Way... P.S. I know, I _am_ evil. Nine years of package maintaining for a linux distribution will turn anyone into cynical bastard ;-) -- Regards, -- Sir Raorn. --- http://thousandsofhate.blogspot.com/
signature.asc
Description: Digital signature
