aboutsummaryrefslogtreecommitdiff
path: root/queue.c
diff options
context:
space:
mode:
Diffstat (limited to 'queue.c')
-rw-r--r--queue.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/queue.c b/queue.c
index e26acbb..2fb9c72 100644
--- a/queue.c
+++ b/queue.c
@@ -47,7 +47,10 @@ queue_get(struct queue *queue, T *data)
47{ 47{
48 if ( queue->head != NULL ) { 48 if ( queue->head != NULL ) {
49 struct queue_item *next = queue->head->next; 49 struct queue_item *next = queue->head->next;
50 *data = queue->head->data; 50
51 if ( data != NULL ) {
52 *data = queue->head->data;
53 }
51 free(queue->head); 54 free(queue->head);
52 queue->head = next; 55 queue->head = next;
53 56