Skip to content

Commit 38f2518

Browse files
committed
Fix the 'for' loop initial declaration in EL7
1 parent 171d034 commit 38f2518

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/mysql_capi.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2086,7 +2086,7 @@ MySQL_query(MySQL *self, PyObject *args, PyObject *kwds)
20862086
{
20872087
PyObject *buffered= NULL, *raw= NULL, *raw_as_string= NULL,
20882088
*query_attrs= NULL, *retval= NULL;
2089-
int res= 0;
2089+
int i= 0, res= 0;
20902090
Py_ssize_t stmt_length;
20912091
char *stmt= NULL;
20922092
static char *kwlist[]=
@@ -2114,7 +2114,6 @@ MySQL_query(MySQL *self, PyObject *args, PyObject *kwds)
21142114
mybinds = calloc(size, sizeof(MYSQL_BIND));
21152115
bindings = calloc(size, sizeof(struct MySQL_binding));
21162116
const char **names = calloc(size, sizeof(char *));
2117-
int i = 0;
21182117

21192118
for (i = 0; i < (int) size; i++) {
21202119
struct MySQL_binding *pbind = &bindings[i];
@@ -2329,7 +2328,7 @@ MySQL_query(MySQL *self, PyObject *args, PyObject *kwds)
23292328
retval = MySQL_handle_result(self);
23302329

23312330
cleanup:
2332-
for (int i = 0; i < size; i++) {
2331+
for (i = 0; i < size; i++) {
23332332
switch (mybinds[i].buffer_type) {
23342333
case MYSQL_TYPE_DECIMAL:
23352334
Py_XDECREF(bindings[i].str_value);

0 commit comments

Comments
 (0)