]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
comples_from_string(): Move s_buffer[] up to the top-level function
authorBarry Warsaw <barry@python.org>
Fri, 18 Aug 2000 05:02:16 +0000 (05:02 +0000)
committerBarry Warsaw <barry@python.org>
Fri, 18 Aug 2000 05:02:16 +0000 (05:02 +0000)
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.

Python/bltinmodule.c

index b9222b612590d8829b7d0e27392030e99a7ce28c..ea1269ed9ea68b891815e5f4c29419817e50712a 100644 (file)
@@ -410,6 +410,7 @@ complex_from_string(PyObject *v)
        int sw_error=0;
        int sign;
        char buffer[256]; /* For errors */
+       char s_buffer[256];
        int len;
 
        if (PyString_Check(v)) {
@@ -417,8 +418,6 @@ complex_from_string(PyObject *v)
                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,
                                 "complex() literal too large to convert");