summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2004-07-15 14:11:30 (GMT)
committerJack Jansen <jack.jansen@cwi.nl>2004-07-15 14:11:30 (GMT)
commitd9e50f554f4ce51681cc399e7ff55cd716898322 (patch)
treeb7589e30b207eb81c5a60ace3b1f46e180919247
parent3bfc28c12f3627470d9e4d1ff18c76cfce54cc02 (diff)
downloadcpython-d9e50f554f4ce51681cc399e7ff55cd716898322.zip
cpython-d9e50f554f4ce51681cc399e7ff55cd716898322.tar.gz
cpython-d9e50f554f4ce51681cc399e7ff55cd716898322.tar.bz2
CFStringGetUnicode() returned an extra null character at the end of the string.
fixed.
-rw-r--r--Mac/Modules/cf/_CFmodule.c2
-rw-r--r--Mac/Modules/cf/cfsupport.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/Mac/Modules/cf/_CFmodule.c b/Mac/Modules/cf/_CFmodule.c
index 1f44a8e..8543331 100644
--- a/Mac/Modules/cf/_CFmodule.c
+++ b/Mac/Modules/cf/_CFmodule.c
@@ -2349,7 +2349,7 @@ static PyObject *CFStringRefObj_CFStringGetUnicode(CFStringRefObject *_self, PyO
range.length = size;
if( data == NULL ) return PyErr_NoMemory();
CFStringGetCharacters(_self->ob_itself, range, data);
- _res = (PyObject *)PyUnicode_FromUnicode(data, size);
+ _res = (PyObject *)PyUnicode_FromUnicode(data, size-1);
free(data);
return _res;
diff --git a/Mac/Modules/cf/cfsupport.py b/Mac/Modules/cf/cfsupport.py
index c244c72..f236e6d 100644
--- a/Mac/Modules/cf/cfsupport.py
+++ b/Mac/Modules/cf/cfsupport.py
@@ -575,7 +575,7 @@ range.location = 0;
range.length = size;
if( data == NULL ) return PyErr_NoMemory();
CFStringGetCharacters(_self->ob_itself, range, data);
-_res = (PyObject *)PyUnicode_FromUnicode(data, size);
+_res = (PyObject *)PyUnicode_FromUnicode(data, size-1);
free(data);
return _res;
"""