summaryrefslogtreecommitdiffstats
path: root/Include
diff options
context:
space:
mode:
authorMarc-André Lemburg <mal@egenix.com>2004-11-22 13:02:31 (GMT)
committerMarc-André Lemburg <mal@egenix.com>2004-11-22 13:02:31 (GMT)
commita9cadcd41b27fd045626c4e3b98315aaa257ca75 (patch)
treede54d0594b72a0b5fbdd6eaecd28a47837597d02 /Include
parent6d60c0962444bb8f6d13208489095144e7752924 (diff)
downloadcpython-a9cadcd41b27fd045626c4e3b98315aaa257ca75.zip
cpython-a9cadcd41b27fd045626c4e3b98315aaa257ca75.tar.gz
cpython-a9cadcd41b27fd045626c4e3b98315aaa257ca75.tar.bz2
Correct the handling of 0-termination of PyUnicode_AsWideChar()
and its usage in PyLocale_strcoll(). Clarify the documentation on this. Thanks to Andreas Degert for pointing this out.
Diffstat (limited to 'Include')
-rw-r--r--Include/unicodeobject.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h
index 0a82caf..6738cbd 100644
--- a/Include/unicodeobject.h
+++ b/Include/unicodeobject.h
@@ -512,10 +512,16 @@ PyAPI_FUNC(PyObject*) PyUnicode_FromWideChar(
int size /* size of buffer */
);
-/* Copies the Unicode Object contents into the whcar_t buffer w. At
+/* Copies the Unicode Object contents into the wchar_t buffer w. At
most size wchar_t characters are copied.
- Returns the number of wchar_t characters copied or -1 in case of an
+ Note that the resulting wchar_t string may or may not be
+ 0-terminated. It is the responsibility of the caller to make sure
+ that the wchar_t string is 0-terminated in case this is required by
+ the application.
+
+ Returns the number of wchar_t characters copied (excluding a
+ possibly trailing 0-termination character) or -1 in case of an
error. */
PyAPI_FUNC(int) PyUnicode_AsWideChar(