New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modbus-tcp.c: unnecessary code repetition #194

Closed
ghost opened this Issue Jan 29, 2014 · 1 comment

Comments

Projects
None yet
1 participant
@ghost

ghost commented Jan 29, 2014

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;

with

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

This comment has been minimized.

Show comment
Hide comment
@stephane

stephane Jan 29, 2014

Owner

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.

Owner

stephane commented Jan 29, 2014

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