mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-11-05 17:28:02 +00:00
tcp.c: Remove side-effects from boolean expressions
This commit is contained in:
parent
b54bf3ccca
commit
79a08c9fee
@ -873,14 +873,16 @@ tcp_new_port(void)
|
||||
struct tcp_pcb *pcb;
|
||||
|
||||
again:
|
||||
if (tcp_port++ == TCP_LOCAL_PORT_RANGE_END) {
|
||||
tcp_port++;
|
||||
if (tcp_port == TCP_LOCAL_PORT_RANGE_END) {
|
||||
tcp_port = TCP_LOCAL_PORT_RANGE_START;
|
||||
}
|
||||
/* Check all PCB lists. */
|
||||
for (i = 0; i < NUM_TCP_PCB_LISTS; i++) {
|
||||
for (pcb = *tcp_pcb_lists[i]; pcb != NULL; pcb = pcb->next) {
|
||||
if (pcb->local_port == tcp_port) {
|
||||
if (++n > (TCP_LOCAL_PORT_RANGE_END - TCP_LOCAL_PORT_RANGE_START)) {
|
||||
n++;
|
||||
if (n > (TCP_LOCAL_PORT_RANGE_END - TCP_LOCAL_PORT_RANGE_START)) {
|
||||
return 0;
|
||||
}
|
||||
goto again;
|
||||
|
Loading…
Reference in New Issue
Block a user