]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Mark Favas was quick to note that the last checkin divides by zero
authorGuido van Rossum <guido@python.org>
Tue, 13 Jul 1999 05:41:12 +0000 (05:41 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 13 Jul 1999 05:41:12 +0000 (05:41 +0000)
when n == 0...  So divide by a->ob_size instead which was already
tested for 0.

Objects/tupleobject.c

index 225835ca85387acdc990fb5f8a4d3baf4500b52c..18b3315cb0107095be287d417c9660fe96f1d6ec 100644 (file)
@@ -374,7 +374,7 @@ tuplerepeat(a, n)
                return (PyObject *)a;
        }
        size = a->ob_size * n;
-       if (size/n != a->ob_size)
+       if (size/a->ob_size != n)
                return PyErr_NoMemory();
        np = (PyTupleObject *) PyTuple_New(size);
        if (np == NULL)