Skip to content

Commit

Permalink
last fix
Browse files Browse the repository at this point in the history
  • Loading branch information
simo981 committed Apr 16, 2024
1 parent 2ec3d59 commit 322bad2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ void free_queue(Queue_t *Q)

void resize(Queue_t *Q)
{
size_t old_size = Q->maxsize;
Q->maxsize *= 2;
Q->words = (input_t **)realloc(Q->words, sizeof(input_t *) * Q->maxsize);
memset(Q->words + old_size, 0x0, sizeof(input_t *) * (Q->maxsize - old_size));
}

0 comments on commit 322bad2

Please sign in to comment.