Skip to content

Commit c1c9864

Browse files
authored
Fix for loop initial declarations C99 error (#496)
1 parent 5906617 commit c1c9864

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
## (unreleased)
22

3+
* Fix compilation errors for Amazon Linux 1. Fixes #495.
4+
35
## 2.1.4
46

57
* Improve handling of network related timeouts

ext/tiny_tds/result.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,14 @@ static void nogvl_cleanup(DBPROCESS *client) {
9999
Now that the blocking operation is done, we can finally throw any
100100
exceptions based on errors from SQL Server.
101101
*/
102-
for (short int i = 0; i < userdata->nonblocking_errors_length; i++) {
102+
short int i;
103+
for (i = 0; i < userdata->nonblocking_errors_length; i++) {
103104
tinytds_errordata error = userdata->nonblocking_errors[i];
104105

105106
// lookahead to drain any info messages ahead of raising error
106107
if (!error.is_message) {
107-
for (short int j = i; j < userdata->nonblocking_errors_length; j++) {
108+
short int j;
109+
for (j = i; j < userdata->nonblocking_errors_length; j++) {
108110
tinytds_errordata msg_error = userdata->nonblocking_errors[j];
109111
if (msg_error.is_message) {
110112
rb_tinytds_raise_error(client, msg_error);

0 commit comments

Comments
 (0)