summaryrefslogtreecommitdiff
path: root/Mac/Modules/cf
diff options
context:
space:
mode:
authorJack Jansen <jack.jansen@cwi.nl>2004-07-15 14:11:30 +0000
committerJack Jansen <jack.jansen@cwi.nl>2004-07-15 14:11:30 +0000
commit647333966324731887250e4cddb92d528f2d258a (patch)
treeef1ce1622462dd4e20021a20be1137522c58f0eb /Mac/Modules/cf
parent0f70a1e76b756297ea92740fe2e4bdc66f9ea4b5 (diff)
downloadcpython-647333966324731887250e4cddb92d528f2d258a.tar.gz
CFStringGetUnicode() returned an extra null character at the end of the string.
fixed.
Diffstat (limited to 'Mac/Modules/cf')
-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 1f44a8eaef..85433319fc 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 c244c727dc..f236e6d374 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;
"""