Quoting Dave Turner (dave_t_tur...@barradas.free-online.co.uk):

> >>I say: You must use strncpy()/strncat() because strcpy()/strcat() are
> >>    soooooo old.

> I still have a copy of the paper that brought strncpy / strncat to
> the world's attention all those years ago.

FWIW, strncpy()/strncat() were a huge advance over strcpy()/strcat(),
but also have their own problems:
https://blog.liw.fi/posts/strncpy/
https://www.reddit.com/r/programming/comments/ifje6/strncpy_just_say_no/

Author Lars Wirzenius (one of our Linux tribal elders!) recommends
instead snprintf (but it has the problem of being slower than
alternatives), or, better in his eyes, using a well-written helper
library instead.  (Lots more opinions at the Reddit thread.)

-- 
Cheers,                                         I could maybe do one pilate.
Rick Moen                                       -- Matt Watson (@biorhythmist)
r...@linuxmafia.com
McQ! (4x80)
_______________________________________________
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng

Reply via email to