Duplicates the first
n bytes of a string, returning a newly-allocated
n + 1 bytes long which will always be nul-terminated. If
is less than
n bytes long the buffer is padded with nuls. If
NULL it returns
NULL. The returned value should be freed when no longer needed.
To copy a number of characters from a UTF-8 encoded string,
The string to duplicate.
|The data is owned by the caller of the function.|
|The string is a NUL terminated UTF-8 string.|
The maximum number of bytes to copy from