[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: strlcpy and strlcat in linux libc ?



elf@buici.com wrote:
[...]
>>>> But somehow, s/n/l/ in the function name is harder to read and the
>>>> function is "inefficient BSD crap".
 
>>> What do you mean here?  Is it that strlcpy is less efficient than
>>> strncpy?
 
>> So say the glibc people in the threads referenced.  If the implementation
>> is flawed, that should be fixed.  The preconditions, postconditions, and
>> function declaration are a fine improvement, however.

> I cannot imagine how an implementation strlcpy is less efficient than
> strncpy unless a programmer depends on the zeroing effect in which
> case she needs to bzero before strlcpy'ing.
[...]

<AOL> I've always thought the main point of using strlcpy instead of
strncpy was performance, because it will stop at \0, while strncpy
will nullify the rest of the target-string, and is therefore slower
than strcpy. That was iirc the essence of a discussion about this on
exim-users about a week ago.
             cu andreas
-- 
Unofficial _Debian-packages_ of latest _tin_
http://www.logic.univie.ac.at/~ametzler/debian/tin-snapshot/



Reply to: