0
0
mirror of https://github.com/python/cpython.git synced 2024-11-28 08:20:55 +01:00

CFStringGetUnicode() returned an extra null character at the end of the string.

fixed.
This commit is contained in:
Jack Jansen 2004-07-15 14:11:30 +00:00
parent 3bfc28c12f
commit d9e50f554f
2 changed files with 2 additions and 2 deletions

View File

@ -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;

View File

@ -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;
"""