[?OT?] strndup exists in FreeBSD?

Steve Franks stevefranks at ieee.org
Mon Apr 14 23:27:44 UTC 2008


>  While it seems like a cool function name, what's the point of having it?
>  If you know how much you want to copy, it's trivial to allocate a buffer
>  large enough and strlcpy() into it.  If you don't know how much you want
>  to copy, then strdup() is ok anyway :)

Granted.  It's just one more thing to hack when porting linux code
(which I'm getting rather tired of doing, I must admit - they seem to
assume everyone likes to include every new api ever concieved, then
they go off and use them...)

Steve


More information about the freebsd-questions mailing list