Subject: Re: CVS commit: src/sys/kern
To: Thomas Klausner <wiz@netbsd.org>
From: Jaromir Dolecek <jdolecek@netbsd.org>
List: source-changes
Date: 05/16/2003 22:08:42
Thomas Klausner wrote:
> From the diffs, I don't think you'll ever notice the difference;
> the changes are not in any "fast" paths whatsoever. And I don't
> think that the speed difference between the two is so big either.
> 
> And I agree with itojun that it's just the safer API to use.

Countrary to this, I agree with Matt. Please don't do wholesale replace
of strcpy() to strlcpy() - it's slower, sometimes very significantly,
since strcpy() is normally implemented in assembler. Furthermore,
gcc can optimize strcpy(), but cannot strlcpy().

Do not do random (and even less wholesale) replace of strcpy()/strcat()
with strl*().

I do think it would be good to migrate from strn*() to
strl*() however.  strl*() API is less prone to programming
mistakes than strn*()

Jaromir
-- 
Jaromir Dolecek <jdolecek@NetBSD.org>            http://www.NetBSD.org/
-=- We should be mindful of the potential goal, but as the tantric    -=-
-=- Buddhist masters say, ``You may notice during meditation that you -=-
-=- sometimes levitate or glow.   Do not let this distract you.''     -=-