back to scratko.xyz
aboutsummaryrefslogtreecommitdiff
path: root/card_queue.c
diff options
context:
space:
mode:
Diffstat (limited to 'card_queue.c')
-rw-r--r--card_queue.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/card_queue.c b/card_queue.c
index ec42b3b..194ea0c 100644
--- a/card_queue.c
+++ b/card_queue.c
@@ -14,11 +14,11 @@ void push_queue(struct card_queue *cq, const char *str)
tmp->str = str;
tmp->next = NULL;
if(!cq->first) {
- cd->first = tmp;
- cd->last = tmp;
+ cq->first = tmp;
+ cq->last = tmp;
} else {
- cd->last->next = tmp;
- cd->last = tmp;
+ cq->last->next = tmp;
+ cq->last = tmp;
}
}
@@ -51,10 +51,11 @@ const char* pop_card_queue(struct card_queue *cq)
int find_out_card_quantity_in_cq(const struct card_queue *cq)
{
int counter = 0;
+ struct card_queue_item *tmp = cq->first;
- while(cq) {
+ while(tmp) {
++counter;
- cq = cq->next;
+ tmp = tmp->next;
}
return counter;
}