pete said:
> Richard Heathfield wrote:
>
>> Richard's attitude towards strncpy is this:
>>
>> (a) it has a lousy name;
>> (b) there is rarely any point in using it;
>> (c) it is likely that most uses of it are flawed;
>> (d) there are occasions on which it is The Right Thing;
>> (e) because of (c), it is tempting to advise people to eschew it
>> completely, but because of (d),
>> he thinks that a better solution would be
>> to educate people about its proper use
>> and to correct their misconception that it is a "safe" strcpy.
>
> I have never written a program that used strncpy,
> except as an academic exercise.
>
> How often do you use strncpy, Dr Heath Field?
Well, I've just checked my current code base here, and can't find any
instances at all. That doesn't mean I won't find instances in older code,
and it doesn't mean I've never used it "on site", so to speak, but it does
seem that I rarely if ever use it. It is entirely possible that, like you,
I have never called it in production code. I don't recall ever doing so,
anyway. But I do know how it works, and I know how to use it if ever the
need should arise. :-)
--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999