From 53d10a3ddf90b8a541ec359ea7bb1e7cb29d08c2 Mon Sep 17 00:00:00 2001 From: Federico Di Gregorio Date: Fri, 1 Sep 2006 08:02:41 +0000 Subject: [PATCH] Fixed compile problems on old gcc. --- psycopg/typecast_basic.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/psycopg/typecast_basic.c b/psycopg/typecast_basic.c index f59e5c32..e9ac7f49 100644 --- a/psycopg/typecast_basic.c +++ b/psycopg/typecast_basic.c @@ -54,11 +54,12 @@ typecast_LONGINTEGER_cast(char *s, int len, PyObject *curs) static PyObject * typecast_FLOAT_cast(char *s, int len, PyObject *curs) { + PyObject *str = NULL, *flo = NULL; char *pend; if (s == NULL) {Py_INCREF(Py_None); return Py_None;} - PyObject *str = PyString_FromStringAndSize(s, len); - PyObject *flo = PyFloat_FromString(str, &pend); + str = PyString_FromStringAndSize(s, len); + flo = PyFloat_FromString(str, &pend); Py_DECREF(str); return flo; }