From 7cdf3e8a8a36fd5ed4bb60f8820efa2f14b7dedc Mon Sep 17 00:00:00 2001 From: Armin Rigo Date: Sat, 20 Mar 2004 21:35:09 +0000 Subject: [PATCH] memset() hunt continuing. This is a net win. --- Objects/tupleobject.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c index 60878a43145..159dc44fd07 100644 --- a/Objects/tupleobject.c +++ b/Objects/tupleobject.c @@ -27,6 +27,7 @@ PyObject * PyTuple_New(register int size) { register PyTupleObject *op; + int i; if (size < 0) { PyErr_BadInternalCall(); return NULL; @@ -68,7 +69,8 @@ PyTuple_New(register int size) if (op == NULL) return NULL; } - memset(op->ob_item, 0, sizeof(*op->ob_item) * size); + for (i=0; i < size; i++) + op->ob_item[i] = NULL; #if MAXSAVESIZE > 0 if (size == 0) { free_tuples[0] = op;