diff --git a/src/queue.c b/src/queue.c index a8c3d0d..5f2d30d 100644 --- a/src/queue.c +++ b/src/queue.c @@ -11,7 +11,6 @@ * along with this program. If not, see . */ -#include #include "xalloc.h" #include "queue.h" @@ -30,7 +29,7 @@ struct node { }; struct ref { - uint16_t i; + unsigned int i; struct node *n; }; @@ -74,6 +73,9 @@ void queue_destroy(queue_t q) { void queue_enqueue(queue_t q, void *obj) { + if (q == NULL) + return; + if (q->head.n == NULL) { q->tail.n = q->head.n = xmalloc(sizeof(struct node)); } else if (q->head.i + 1 >= BLOCK_SIZE) {