1 parent ca38c95 commit 3c5178eCopy full SHA for 3c5178e
1 file changed
src/modbus-tcp.c
@@ -525,7 +525,8 @@ static int _modbus_tcp_flush(modbus_t *ctx)
525
}
526
} while (rc == MODBUS_TCP_MAX_ADU_LENGTH);
527
528
- return rc_sum;
+ /* Cast is safe: uint16_t always fits in int, and overflow is checked above */
529
+ return (int) rc_sum;
530
531
532
/* Listens for any request from one or many modbus masters in TCP */
0 commit comments