Hello!
Checking for NULL is useless, since npcb should not be NULL (after the
loop npcb->next is accessed unconditially).
---
src/include/lwip/tcp.h | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
Index: lwip/src/include/lwip/tcp.h
===================================================================
--- lwip.orig/src/include/lwip/tcp.h
+++ lwip/src/include/lwip/tcp.h
@@ -651,7 +651,7 @@ extern struct tcp_pcb *tcp_tmp_pcb;
if(*pcbs == npcb) { \
*pcbs = (*pcbs)->next; \
} else for(tcp_tmp_pcb = *pcbs; tcp_tmp_pcb !=
NULL; tcp_tmp_pcb = tcp_tmp_pcb->next) { \
- if(tcp_tmp_pcb->next != NULL &&
tcp_tmp_pcb->next == npcb) { \
+ if(tcp_tmp_pcb->next == npcb) { \
tcp_tmp_pcb->next = npcb->next; \
break; \
} \
@@ -676,10 +676,10 @@ extern struct tcp_pcb *tcp_tmp_pcb;
(*(pcbs)) = (*pcbs)->next; \
} \
else { \
- for(tcp_tmp_pcb = *pcbs; \
- tcp_tmp_pcb != NULL; \
- tcp_tmp_pcb = tcp_tmp_pcb->next) { \
- if(tcp_tmp_pcb->next != NULL && tcp_tmp_pcb->next == npcb) { \
+ for(tcp_tmp_pcb = *pcbs; \
+ tcp_tmp_pcb != NULL; \
+ tcp_tmp_pcb = tcp_tmp_pcb->next) { \
+ if(tcp_tmp_pcb->next == npcb) { \
tcp_tmp_pcb->next = npcb->next; \
break; \
} \
_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users