"James Hawkins" truiken@gmail.com writes:
Is there anything wrong with this patch?
Yes, the length does include the terminating null. That's what the rest of the function expects, and AFAICT it's what the callers expect too (and it's the standard behavior of API functions that take a buffer length).