From: Neal Norwitz Date: Sun, 23 Jul 2006 07:53:14 +0000 (+0000) Subject: Move the initialization of size_a down below the check for a being NULL. X-Git-Tag: v2.5b3~196 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c09efa844419b801ba9d9db9e04ccfb2af59d7f3;p=python Move the initialization of size_a down below the check for a being NULL. Reported by Klocwork #106 --- diff --git a/Objects/longobject.c b/Objects/longobject.c index cbd6f2be59..4ce947955a 100644 --- a/Objects/longobject.c +++ b/Objects/longobject.c @@ -1203,7 +1203,7 @@ long_format(PyObject *aa, int base, int addL) register PyLongObject *a = (PyLongObject *)aa; PyStringObject *str; Py_ssize_t i; - const Py_ssize_t size_a = ABS(a->ob_size); + Py_ssize_t size_a; char *p; int bits; char sign = '\0'; @@ -1213,6 +1213,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;