summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@haypocalc.com>2010-10-02 11:03:13 (GMT)
committerVictor Stinner <victor.stinner@haypocalc.com>2010-10-02 11:03:13 (GMT)
commit1c24bd02520a647415de5c220834d7bec265a8d0 (patch)
treeaee2e4580a0fb8b3027733119d4836566ac8b2d5 /Objects
parent5a2da3b3adc6d36fcebac0c4aeceffa1ff4e4d33 (diff)
downloadcpython-1c24bd02520a647415de5c220834d7bec265a8d0.zip
cpython-1c24bd02520a647415de5c220834d7bec265a8d0.tar.gz
cpython-1c24bd02520a647415de5c220834d7bec265a8d0.tar.bz2
Issue #8870: PyUnicode_AsWideCharString() doesn't count the trailing nul character
And write unit tests for PyUnicode_AsWideChar() and PyUnicode_AsWideCharString().
Diffstat (limited to 'Objects')
-rw-r--r--Objects/unicodeobject.c2
1 files changed, 1 insertions, 1 deletions
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 @@ PyUnicode_AsWideCharString(PyUnicodeObject *unicode,
}
unicode_aswidechar(unicode, buffer, buflen);
if (size)
- *size = buflen;
+ *size = buflen - 1;
return buffer;
}