On Sun 14.Mar'10 at 12:19:59 +0100, Tamas TEVESZ wrote:
> On Sun, 14 Mar 2010, Paul Harris wrote:
> 
>  > I hadn't heard of strlcpy before,so I googled it:
>  > http://www.cppreference.com/wiki/c/string/strlcpy
>  > 
>  > why not just use strncpy ?
> 
> because strlcpy/strlcat is much easier, and it can easily be bundled 
> to be used on systems lacking it.

I am not an expert on this, but the rant on the above page has a 
point about strlcpy() hiding bugs, IMHO. So I guess simply
religiouly converting strncpy() (or worse strcpy()) to strlcpy() 
may not be always the right thing to do. 

It would seem better to think about checking the uses of strncpy()
and act based on that.

> of course i'd be relying heavily on sir raorn to do the autoconf stuff
> :)

I've seen that the 'git' source code has some checks for strlcpy(),
perhaps stealing what they do would be nice. 

And the _whole_ configuration process of 'git' seems a lot cleaner too 
(the Makefile itself is tracked!). For example, when I added the (hackish)
--disable-verbose-compile to wmaker I was inspired by the clean output of
git, so I would be happy to steal the whole thing altogether.


-- 
To unsubscribe, send mail to [email protected].

Reply via email to