variables
This commit is contained in:
parent
df7d0ccd00
commit
69eaba6642
16
cv9/snake.c
16
cv9/snake.c
@ -18,16 +18,16 @@ struct snake* remove_snake(struct snake* snake){
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct snake* prev = NULL;
|
struct snake* predtym = NULL;
|
||||||
struct snake* current = snake;
|
struct snake* teraz = snake;
|
||||||
while (current->next != NULL) {
|
while (teraz->next != NULL) {
|
||||||
prev = current;
|
predtym = teraz;
|
||||||
current = current->next;
|
teraz = teraz->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
free(current);
|
free(teraz);
|
||||||
prev->next = NULL;
|
predtym->next = NULL;
|
||||||
|
|
||||||
return snake;
|
return snake;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user