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

Skip to content

Commit 67c1a04

Browse files
committed
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.
1 parent dc55d71 commit 67c1a04

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

Objects/floatobject.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,15 +133,14 @@ PyFloat_FromString(PyObject *v, char **pend)
133133
const char *s, *last, *end;
134134
double x;
135135
char buffer[256]; /* For errors */
136+
char s_buffer[256];
136137
int len;
137138

138139
if (PyString_Check(v)) {
139140
s = PyString_AS_STRING(v);
140141
len = PyString_GET_SIZE(v);
141142
}
142143
else if (PyUnicode_Check(v)) {
143-
char s_buffer[256];
144-
145144
if (PyUnicode_GET_SIZE(v) >= sizeof(s_buffer)) {
146145
PyErr_SetString(PyExc_ValueError,
147146
"float() literal too large to convert");

0 commit comments

Comments
 (0)