diff --git a/src/modbus.c b/src/modbus.c index 7dcc50e..7c01940 100644 --- a/src/modbus.c +++ b/src/modbus.c @@ -640,22 +640,23 @@ static int response_io_status(int address, int nb, uint8_t *rsp, int offset) { int shift = 0; - int byte = 0; + /* Instead of byte (not allowed in Win32) */ + int one_byte = 0; int i; for (i = address; i < address+nb; i++) { - byte |= tab_io_status[i] << shift; + one_byte |= tab_io_status[i] << shift; if (shift == 7) { /* Byte is full */ - rsp[offset++] = byte; - byte = shift = 0; + rsp[offset++] = one_byte; + one_byte = shift = 0; } else { shift++; } } if (shift != 0) - rsp[offset++] = byte; + rsp[offset++] = one_byte; return offset; }