There may be a larger pattern here I'm missing, but the name
`apr_pstrndup' makes me think of the ANSI `strn' functions ---
strncat, strncmp, and strncpy. However, its behavior doesn't match.
Each ANSI `strn' function is like the corresponding `str' function,
except that it takes an additional argument N which establishes the
*maximum* number of characters to process --- if we find a '\0' in the
string before the N'th, we'll stop there. So the effective length is
the shorter of N and strlen (the string).
The `apr_pstrndup' function, however, uses the length as the number of
bytes to copy, and ignores any '\0' characters it finds. This is like
the ANSI `mem' functions. So if the implementation of apr_pstrndup is
correct (it's certainly the behavior I want), perhaps it should be
named apr_pmemdup. But in any case, `strn' seems like the wrong
Received on Sat Oct 21 14:36:12 2006