Skip to content

Commit 082d532

Browse files
committed
Don't use loop initial declaration (closes #752)
C99 remains too modern :/
1 parent 1365023 commit 082d532

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/modbus.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1193,6 +1193,7 @@ static int read_io_status(modbus_t *ctx, int function, int addr, int nb, uint8_t
11931193
int pos = 0;
11941194
unsigned int offset;
11951195
unsigned int offset_end;
1196+
unsigned int i;
11961197

11971198
rc = _modbus_receive_msg(ctx, rsp, MSG_CONFIRMATION);
11981199
if (rc == -1)
@@ -1204,7 +1205,7 @@ static int read_io_status(modbus_t *ctx, int function, int addr, int nb, uint8_t
12041205

12051206
offset = ctx->backend->header_length + 2;
12061207
offset_end = offset + rc;
1207-
for (unsigned int i = offset; i < offset_end; i++) {
1208+
for (i = offset; i < offset_end; i++) {
12081209
/* Shift reg hi_byte to temp */
12091210
temp = rsp[i];
12101211

0 commit comments

Comments
 (0)