summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-04-06 08:05:53 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2006-04-06 08:05:53 (GMT)
commitb038333d4b1d974d3338b58586480eb5fa676aaf (patch)
tree750ce3ffbcf688ee56168790bd0cf56008b8da95 /Modules
parent5102c4e385689a1d3c67eccefa2a4b7ac6686712 (diff)
downloadcpython-b038333d4b1d974d3338b58586480eb5fa676aaf.zip
cpython-b038333d4b1d974d3338b58586480eb5fa676aaf.tar.gz
cpython-b038333d4b1d974d3338b58586480eb5fa676aaf.tar.bz2
Handle ssize_t
No need to INCREF then let PyString_ConcatAndDel() DECREF. Just use PyString_Concat(). Handle error condition if we can't concat.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_ctypes/_ctypes.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/Modules/_ctypes/_ctypes.c b/Modules/_ctypes/_ctypes.c
index bd8bf3c..0743ec9 100644
--- a/Modules/_ctypes/_ctypes.c
+++ b/Modules/_ctypes/_ctypes.c
@@ -1271,7 +1271,7 @@ static PyObject *CreateSwappedType(PyTypeObject *type, PyObject *args, PyObject
PyObject *name = PyTuple_GET_ITEM(args, 0);
PyObject *swapped_args;
static PyObject *suffix;
- int i;
+ Py_ssize_t i;
swapped_args = PyTuple_New(PyTuple_GET_SIZE(args));
if (!swapped_args)
@@ -1284,8 +1284,9 @@ static PyObject *CreateSwappedType(PyTypeObject *type, PyObject *args, PyObject
suffix = PyString_FromString("_be");
#endif
- Py_INCREF(suffix);
- PyString_ConcatAndDel(&name, suffix);
+ PyString_Concat(&name, suffix);
+ if (name == NULL)
+ return NULL;
PyTuple_SET_ITEM(swapped_args, 0, name);
for (i=1; i<PyTuple_GET_SIZE(args); ++i) {