Skip to content
Snippets Groups Projects
Commit 5a3fa70ed7bc authored by miaoerduo's avatar miaoerduo
Browse files

fix: errors in replacing the first item when array_size is 1, and replacing the last item

parent 4588f15d4fb4
No related branches found
No related tags found
No related merge requests found
......@@ -2313,6 +2313,10 @@
}
if (parent->child == item)
{
if (parent->child->prev == parent->child)
{
replacement->prev = replacement;
}
parent->child = replacement;
}
else
......@@ -2324,6 +2328,10 @@
{
replacement->prev->next = replacement;
}
if (replacement->next == NULL)
{
parent->child->prev = replacement;
}
}
item->next = NULL;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment