modbus-tcp.c: unnecessary code repetition #194

MarjanTomas opened this Issue Jan 29, 2014 · 1 comment

2 participants


in src/modbus-tcp.c the lines 274 and 282 are identical

rc = connect(sockfd, addr, addrlen);

the code can by simplified by removing both lines and replacing line 269

int rc;


int rc = connect(sockfd, addr, addrlen);

Ah yes! I did that to avoid 'int' declaration after a call but didn't see 'int' could be placed on connect() line.
Thank you.

@stephane stephane closed this in 29851c2 Jan 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment