Remove useless loop

This commit is contained in:
Franck STAUFFER 2020-09-08 23:04:38 +02:00
parent 37a0fd3a19
commit 5637f9e476
Signed by: franck.stauffer
GPG Key ID: AAF5A94045CEC261
1 changed files with 4 additions and 6 deletions

View File

@ -55,12 +55,10 @@ negotiate(unsigned char* buf)
return 1;
}
for (uint_fast8_t i = 0; i < 3; ++i) {
if (buf[i] == DO)
buf[i] = WONT;
else if (buf[i] == WILL)
buf[i] = DO;
}
if (buf[1] == DO)
buf[1] = WONT;
else if (buf[1] == WILL)
buf[1] = DO;
if (send(sock, buf, 3, 0) != 3) {
perror("ERROR: send");