浏览代码

Backport fix receiving of incorrect queries in write_single

Stéphane Raimbault 11 年之前
父节点
当前提交
b7fabe4e96
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/modbus.c

+ 1 - 1
src/modbus.c

@@ -1135,7 +1135,7 @@ static int write_single(modbus_t *ctx, int function, int addr, int value)
     rc = send_msg(ctx, req, req_length);
     if (rc > 0) {
         /* Used by write_bit and write_register */
-        uint8_t rsp[_MIN_REQ_LENGTH];
+        uint8_t rsp[MAX_MESSAGE_LENGTH];
 
         rc = receive_msg(ctx, rsp, MSG_CONFIRMATION);
         if (rc == -1)