summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
Diffstat (limited to 'Objects')
-rw-r--r--Objects/listobject.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/Objects/listobject.c b/Objects/listobject.c
index efcedc7..9fbc463 100644
--- a/Objects/listobject.c
+++ b/Objects/listobject.c
@@ -2177,7 +2177,7 @@ PyObject *
PyList_AsTuple(PyObject *v)
{
PyObject *w;
- PyObject **p;
+ PyObject **p, **q;
Py_ssize_t n;
if (v == NULL || !PyList_Check(v)) {
PyErr_BadInternalCall();
@@ -2188,12 +2188,12 @@ PyList_AsTuple(PyObject *v)
if (w == NULL)
return NULL;
p = ((PyTupleObject *)w)->ob_item;
- memcpy((void *)p,
- (void *)((PyListObject *)v)->ob_item,
- n*sizeof(PyObject *));
+ q = ((PyListObject *)v)->ob_item;
while (--n >= 0) {
- Py_INCREF(*p);
+ Py_INCREF(*q);
+ *p = *q;
p++;
+ q++;
}
return w;
}