Kieran Mansley - kjm25@cam.ac.uk - 24th Nov 2004

* Increased argument checking at start of pbuf_queue() and made resulting errors more verbose
This commit is contained in:
kieranm 2004-11-24 17:03:03 +00:00
parent 6b0852a21f
commit 64aa4c716d

View File

@ -723,9 +723,13 @@ pbuf_queue(struct pbuf *p, struct pbuf *n)
struct pbuf *q = p;
#endif
/* programmer stupidity checks */
LWIP_ASSERT("p != NULL", p != NULL);
LWIP_ASSERT("n != NULL", n != NULL);
if ((p == NULL) || (n == NULL)) return;
LWIP_ASSERT("p == NULL in pbuf_queue: this indicates a programmer error\n", p != NULL);
LWIP_ASSERT("n == NULL in pbuf_queue: this indicates a programmer error\n", n != NULL);
LWIP_ASSERT("p == n in pbuf_queue: this indicates a programmer error\n", p != n);
if ((p == NULL) || (n == NULL) || (p == n)){
LWIP_ERRORF(PBUF_DEBUG | DBG_HALT | 3, ("pbuf_queue: programmer argument error\n"))
return;
}
/* iterate through all packets on queue */
while (p->next != NULL) {