mirror of
https://github.com/python/cpython.git
synced 2025-08-01 07:33:08 +00:00
CFStringGetUnicode() returned an extra null character at the end of the string.
fixed.
This commit is contained in:
parent
3bfc28c12f
commit
d9e50f554f
2 changed files with 2 additions and 2 deletions
|
@ -2349,7 +2349,7 @@ static PyObject *CFStringRefObj_CFStringGetUnicode(CFStringRefObject *_self, PyO
|
||||||
range.length = size;
|
range.length = size;
|
||||||
if( data == NULL ) return PyErr_NoMemory();
|
if( data == NULL ) return PyErr_NoMemory();
|
||||||
CFStringGetCharacters(_self->ob_itself, range, data);
|
CFStringGetCharacters(_self->ob_itself, range, data);
|
||||||
_res = (PyObject *)PyUnicode_FromUnicode(data, size);
|
_res = (PyObject *)PyUnicode_FromUnicode(data, size-1);
|
||||||
free(data);
|
free(data);
|
||||||
return _res;
|
return _res;
|
||||||
|
|
||||||
|
|
|
@ -575,7 +575,7 @@ range.location = 0;
|
||||||
range.length = size;
|
range.length = size;
|
||||||
if( data == NULL ) return PyErr_NoMemory();
|
if( data == NULL ) return PyErr_NoMemory();
|
||||||
CFStringGetCharacters(_self->ob_itself, range, data);
|
CFStringGetCharacters(_self->ob_itself, range, data);
|
||||||
_res = (PyObject *)PyUnicode_FromUnicode(data, size);
|
_res = (PyObject *)PyUnicode_FromUnicode(data, size-1);
|
||||||
free(data);
|
free(data);
|
||||||
return _res;
|
return _res;
|
||||||
"""
|
"""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue