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

View File

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