From 8057bbf45fd8dc70423271c14f50b099021b5cfe Mon Sep 17 00:00:00 2001 From: Stéphane Raimbault Date: Wed, 4 May 2011 00:15:08 +0200 Subject: [PATCH] Avoid an iteration in flush function --- src/modbus-tcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modbus-tcp.c b/src/modbus-tcp.c index 01661e9..eb42f49 100644 --- a/src/modbus-tcp.c +++ b/src/modbus-tcp.c @@ -354,7 +354,7 @@ int _modbus_tcp_flush(modbus_t *ctx) if (ctx->debug && rc != -1) { printf("\n%d bytes flushed\n", rc); } - } while (rc > 0); + } while (rc == MODBUS_TCP_MAX_ADU_LENGTH); return rc; } -- libgit2 0.21.4