commit | 1c24bd02520a647415de5c220834d7bec265a8d0 | [log] [tgz] |
---|---|---|
author | Victor Stinner <victor.stinner@haypocalc.com> | Sat Oct 02 11:03:13 2010 +0000 |
committer | Victor Stinner <victor.stinner@haypocalc.com> | Sat Oct 02 11:03:13 2010 +0000 |
tree | aee2e4580a0fb8b3027733119d4836566ac8b2d5 | |
parent | 5a2da3b3adc6d36fcebac0c4aeceffa1ff4e4d33 [diff] |
Issue #8870: PyUnicode_AsWideCharString() doesn't count the trailing nul character And write unit tests for PyUnicode_AsWideChar() and PyUnicode_AsWideCharString().
diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index 29404c3..1c083b2 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c
@@ -1216,7 +1216,7 @@ } unicode_aswidechar(unicode, buffer, buflen); if (size) - *size = buflen; + *size = buflen - 1; return buffer; }