Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5ca1ef9

Browse files
committed
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.
1 parent 9d23a4e commit 5ca1ef9

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

Python/bltinmodule.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,15 +410,14 @@ complex_from_string(PyObject *v)
410410
int sw_error=0;
411411
int sign;
412412
char buffer[256]; /* For errors */
413+
char s_buffer[256];
413414
int len;
414415

415416
if (PyString_Check(v)) {
416417
s = PyString_AS_STRING(v);
417418
len = PyString_GET_SIZE(v);
418419
}
419420
else if (PyUnicode_Check(v)) {
420-
char s_buffer[256];
421-
422421
if (PyUnicode_GET_SIZE(v) >= sizeof(s_buffer)) {
423422
PyErr_SetString(PyExc_ValueError,
424423
"complex() literal too large to convert");

0 commit comments

Comments
 (0)