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

strlcpy manpage



At the bottom strlcpy manpage, there's an example:

char *dir, *file, pname[MAXPATHLEN];
size_t n;

...

n = strlcpy(pname, dir, sizeof(pname));
if (n >= sizeof(pname))
	goto toolong;
if (strlcpy(pname + n, file, sizeof(pname) - n) >= sizeof(pname) -n)
	goto toolong;

Earlier in the manpage, it says arg 1 of strlcpy should be a true "C"
string.  Is the " + n" in the second strlcpy an error, or am I missing
something here?

--
<jakemsr@jakemsr.com>