mirror of
https://github.com/python/cpython.git
synced 2025-07-28 21:55:21 +00:00
Issue #8870: PyUnicode_AsWideCharString() doesn't count the trailing nul character
And write unit tests for PyUnicode_AsWideChar() and PyUnicode_AsWideCharString().
This commit is contained in:
parent
5a2da3b3ad
commit
1c24bd0252
4 changed files with 105 additions and 11 deletions
|
@ -466,7 +466,8 @@ wchar_t support for platforms which support it:
|
|||
|
||||
Convert the Unicode object to a wide character string. The output string
|
||||
always ends with a nul character. If *size* is not *NULL*, write the number
|
||||
of wide characters (including the nul character) into *\*size*.
|
||||
of wide characters (excluding the trailing 0-termination character) into
|
||||
*\*size*.
|
||||
|
||||
Returns a buffer allocated by :cfunc:`PyMem_Alloc` (use :cfunc:`PyMem_Free`
|
||||
to free it) on success. On error, returns *NULL*, *\*size* is undefined and
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue