strlcpy

Patrick Goetz pgoetz at mail.utexas.edu
Wed Sep 1 17:58:45 UTC 2010


On 07/21/2010 09:01 PM, Henrique de Moraes Holschuh wrote:
> That is an argument you should never make.  If a system doesn't have
> strlcpy, it is uninteresting crap, and it will have to provide one through
> gnulib or something.
>

My bad.  It was only after sending this that I noticed strlcpy is a 
local function defined in ~/lib/xstrlcpy.h

I personally don't really see the point of this function, since len in
  size_t strlcpy(char *dest, const char *src, size_t len)
isn't constrained to be sizeof(*dest).  Also, the cyrus version of 
strlcpy doesn't end nicely (i.e. probably crashes the process) if the 
source string isn't \0 terminated.  It seems like this has mostly the 
same type of problems as strncpy, just re-arranged.  But that's 
irrelevant, since the function is being used.

> Debian systems *always* have strlcpy, anyway.
>

Whereabouts?  It should probably be in glibc, but it seems the 
maintainer has the same issues with it that I do 
(http://en.wikipedia.org/wiki/Strlcpy)

Anyway, strlcpy isn't quite as silly as the N+1 implementations of 
xmalloc....




More information about the Pkg-Cyrus-imapd-Debian-devel mailing list