mirror of
https://github.com/python/cpython.git
synced 2025-07-24 19:54: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
|
@ -1216,7 +1216,7 @@ PyUnicode_AsWideCharString(PyUnicodeObject *unicode,
|
|||
}
|
||||
unicode_aswidechar(unicode, buffer, buflen);
|
||||
if (size)
|
||||
*size = buflen;
|
||||
*size = buflen - 1;
|
||||
return buffer;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue