:: Re: [DNG] The D in Systemd stands f…
トップ ページ
このメッセージを削除
このメッセージに返信
著者: Rick Moen
日付:  
To: dng
題目: Re: [DNG] The D in Systemd stands for 'Dammmmit!'
Quoting Dave Turner (dave_t_turner@???):

> >>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)
rick@???
McQ! (4x80)