This commit is contained in:
jacekpoz 2024-03-10 14:14:44 +01:00
parent 761c019407
commit 13bcfc37f6
Signed by: poz
SSH key fingerprint: SHA256:JyLeVWE4bF3tDnFeUpUaJsPsNlJyBldDGV/dIKSLyN8

View file

@ -15,7 +15,7 @@ Queue *queue_new(size_t length, size_t element_size) {
Queue *ret = malloc(sizeof(Queue));
ret->back = 0;
ret->front = 0;
ret->length = length;
ret->length = length + 1;
ret->element_size = element_size;
ret->data = malloc((length + 1) * sizeof(void*));