Fixed compile problems on old gcc.

This commit is contained in:
Federico Di Gregorio 2006-09-01 08:02:41 +00:00
parent 6f0e578686
commit 53d10a3ddf

View File

@ -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;
}