From b1d70432909818983b59de1245562cb89040e7ce Mon Sep 17 00:00:00 2001 From: "Andrew M. Kuchling" Date: Tue, 3 Oct 2006 18:52:07 +0000 Subject: [Backport r50779 | neal.norwitz] Move the initialization of size_a down below the check for a being NULL. Reported by Klocwork #106. [Slight change required: in 2.5 Py_ssize_t is used, but 2.4 uses int.] --- Objects/longobject.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Objects/longobject.c b/Objects/longobject.c index 0a354f1..f4a9a42 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -1043,7 +1043,7 @@ long_format(PyObject *aa, int base, int addL) register PyLongObject *a = (PyLongObject *)aa; PyStringObject *str; int i; - const int size_a = ABS(a->ob_size); + int size_a; char *p; int bits; char sign = '\0'; @@ -1053,6 +1053,7 @@ long_format(PyObject *aa, int base, int addL) return NULL; } assert(base >= 2 && base <= 36); + size_a = ABS(a->ob_size); /* Compute a rough upper bound for the length of the string */ i = base; -- cgit v0.12