diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 2004-07-15 14:11:30 +0000 |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 2004-07-15 14:11:30 +0000 |
commit | 647333966324731887250e4cddb92d528f2d258a (patch) | |
tree | ef1ce1622462dd4e20021a20be1137522c58f0eb /Mac | |
parent | 0f70a1e76b756297ea92740fe2e4bdc66f9ea4b5 (diff) | |
download | cpython-647333966324731887250e4cddb92d528f2d258a.tar.gz |
CFStringGetUnicode() returned an extra null character at the end of the string.
fixed.
Diffstat (limited to 'Mac')
-rw-r--r-- | Mac/Modules/cf/_CFmodule.c | 2 | ||||
-rw-r--r-- | Mac/Modules/cf/cfsupport.py | 2 |
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; """ |