From 4abb548795fb94a8832f9a735823fb4d85b14ca3 Mon Sep 17 00:00:00 2001 From: Stéphane Raimbault Date: Thu, 28 Oct 2010 18:58:46 +0200 Subject: [PATCH] Initialize socket to -1 to avoid write on standard output --- src/modbus.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modbus.c b/src/modbus.c index 1cd9aed..b741c4c 100644 --- a/src/modbus.c +++ b/src/modbus.c @@ -1225,8 +1225,9 @@ int modbus_report_slave_id(modbus_t *ctx, uint8_t *data_dest) void _modbus_init_common(modbus_t *ctx) { - /* Slave is initialized to -1 */ + /* Slave and socket are initialized to -1 */ ctx->slave = -1; + ctx->s = -1; ctx->debug = FALSE; ctx->error_recovery = FALSE; -- libgit2 0.21.4