@@ -18019,8 +18019,9 @@ static PyObject* ibm_db_fetch_callproc(PyObject* self, PyObject* args)
1801918019 LogMsg(DEBUG, "Processing SQL_CHAR array element using svalue");
1802018020 char *elem_ptr = curr->svalue + i * curr->param_size;
1802118021 size_t max_len = curr->param_size;
18022+ size_t actual_len;
1802218023#ifndef __MVS__
18023- size_t actual_len = strnlen(elem_ptr, max_len);
18024+ actual_len = strnlen(elem_ptr, max_len);
1802418025#endif
1802518026 elem = PyBytes_FromStringAndSize(elem_ptr, actual_len);
1802618027 if (!elem) {
@@ -18081,8 +18082,9 @@ static PyObject* ibm_db_fetch_callproc(PyObject* self, PyObject* args)
1808118082 LogMsg(DEBUG, "Processing SQL_VARCHAR array element using svalue");
1808218083 char *elem_ptr = curr->svalue + i * curr->param_size;
1808318084 size_t max_len = curr->param_size;
18085+ size_t actual_len;
1808418086#ifndef __MVS__
18085- size_t actual_len = strnlen(elem_ptr, max_len);
18087+ actual_len = strnlen(elem_ptr, max_len);
1808618088#endif
1808718089 elem = PyBytes_FromStringAndSize(elem_ptr, actual_len);
1808818090 } else if (curr->ts_value) {
@@ -18127,8 +18129,9 @@ static PyObject* ibm_db_fetch_callproc(PyObject* self, PyObject* args)
1812718129 } else if(curr->svalue){
1812818130 LogMsg(DEBUG, "Processing SQL_BINARY/SQL_VARBINARY/SQL_LONGVARBINARY array element using svalue");
1812918131 char *elem_ptr = curr->svalue + i * curr->param_size;
18132+ size_t actual_len;
1813018133#ifndef __MVS__
18131- size_t actual_len = strnlen(elem_ptr, curr->param_size);
18134+ actual_len = strnlen(elem_ptr, curr->param_size);
1813218135#endif
1813318136 elem = PyBytes_FromStringAndSize(elem_ptr, actual_len);
1813418137 if (!elem) {
@@ -18458,8 +18461,9 @@ static PyObject* ibm_db_fetch_callproc(PyObject* self, PyObject* args)
1845818461 }
1845918462 } else if (curr->svalue) {
1846018463 LogMsg(DEBUG, "Processing scalar SQL_VARCHAR using svalue");
18464+ size_t actual_len;
1846118465#ifndef __MVS__
18462- size_t actual_len = strnlen(curr->svalue, curr->param_size);
18466+ actual_len = strnlen(curr->svalue, curr->param_size);
1846318467#endif
1846418468 pyVal = PyUnicode_Decode(curr->svalue, actual_len, "utf-8", "strict");
1846518469 if (!pyVal) {
0 commit comments