comples_from_string(): 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.
This commit is contained in:
Barry Warsaw 2000-08-18 05:02:16 +00:00
parent 9d23a4eb03
commit 5ca1ef9238
1 changed files with 1 additions and 2 deletions

View 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");