mirror of
https://github.com/python/cpython.git
synced 2025-08-01 15:43:13 +00:00
Fix some Py_ssize_t issues
This commit is contained in:
parent
c7074386b4
commit
047f3c7ffa
3 changed files with 10 additions and 9 deletions
|
@ -932,12 +932,13 @@ AsObj(PyObject *value)
|
|||
#ifdef Py_USING_UNICODE
|
||||
else if (PyUnicode_Check(value)) {
|
||||
Py_UNICODE *inbuf = PyUnicode_AS_UNICODE(value);
|
||||
int size = PyUnicode_GET_SIZE(value);
|
||||
Py_ssize_t size = PyUnicode_GET_SIZE(value);
|
||||
/* This #ifdef assumes that Tcl uses UCS-2.
|
||||
See TCL_UTF_MAX test above. */
|
||||
#if defined(Py_UNICODE_WIDE) && TCL_UTF_MAX == 3
|
||||
Tcl_UniChar *outbuf;
|
||||
int i;
|
||||
Py_ssize_t i;
|
||||
assert(size < size * sizeof(Tcl_UniChar));
|
||||
outbuf = (Tcl_UniChar*)ckalloc(size * sizeof(Tcl_UniChar));
|
||||
if (!outbuf) {
|
||||
PyErr_NoMemory();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue