summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2000-08-18 05:00:03 (GMT)
committerBarry Warsaw <barry@python.org>2000-08-18 05:00:03 (GMT)
commit67c1a04bbbad20a6a66aa32d35fe41baf2660a51 (patch)
tree4b019a84cab7011ecd1759be8a9cdee7959ea33e
parentdc55d715bbe23ccda3942da667211ff796f31ed2 (diff)
downloadcpython-67c1a04bbbad20a6a66aa32d35fe41baf2660a51.zip
cpython-67c1a04bbbad20a6a66aa32d35fe41baf2660a51.tar.gz
cpython-67c1a04bbbad20a6a66aa32d35fe41baf2660a51.tar.bz2
PyFloat_FromString(): Move s_buffer[] up to the top-level function
scope. Previously, s_buffer[] was defined inside the PyUnicode_Check() scope, but referred to in the outer scope via assignment to s. This quiets an Insure portability warning.
-rw-r--r--Objects/floatobject.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Objects/floatobject.c b/Objects/floatobject.c
index 26b39e8..5650b41 100644
--- a/Objects/floatobject.c
+++ b/Objects/floatobject.c
@@ -133,6 +133,7 @@ PyFloat_FromString(PyObject *v, char **pend)
const char *s, *last, *end;
double x;
char buffer[256]; /* For errors */
+ char s_buffer[256];
int len;
if (PyString_Check(v)) {
@@ -140,8 +141,6 @@ PyFloat_FromString(PyObject *v, char **pend)
len = PyString_GET_SIZE(v);
}
else if (PyUnicode_Check(v)) {
- char s_buffer[256];
-
if (PyUnicode_GET_SIZE(v) >= sizeof(s_buffer)) {
PyErr_SetString(PyExc_ValueError,
"float() literal too large to convert");