From: Andrew M. Kuchling Date: Tue, 3 Oct 2006 18:52:07 +0000 (+0000) Subject: [Backport r50779 | neal.norwitz] X-Git-Tag: v2.4.4c1~69 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b1d70432909818983b59de1245562cb89040e7ce;p=thirdparty%2FPython%2Fcpython.git [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.] --- diff --git a/Objects/longobject.c b/Objects/longobject.c index 0a354f1d854f..f4a9a42e87e7 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;