diff options
Diffstat (limited to 'queue.c')
| -rw-r--r-- | queue.c | 4 |
1 files changed, 2 insertions, 2 deletions
| @@ -53,10 +53,10 @@ queue_put(struct queue *queue, T data) | |||
| 53 | bool | 53 | bool |
| 54 | queue_get(struct queue *queue, T *data) | 54 | queue_get(struct queue *queue, T *data) |
| 55 | { | 55 | { |
| 56 | if ( queue->head != NULL ) { | 56 | if ( queue->head ) { |
| 57 | struct queue_item *next = queue->head->next; | 57 | struct queue_item *next = queue->head->next; |
| 58 | 58 | ||
| 59 | if ( data != NULL ) { | 59 | if ( data ) { |
| 60 | *data = queue->head->data; | 60 | *data = queue->head->data; |
| 61 | } | 61 | } |
| 62 | free(queue->head); | 62 | free(queue->head); |
