Create a gist now

Instantly share code, notes, and snippets.

@eric-wieser /deleteNode.c Secret
Last active Dec 12, 2015

void deleteNode(tList *list, tListNode *obsoleteNode)
{
tListNode **nodePtr;
for(nodePtr = &list->head; *nodePtr != NULL; nodePtr = &(*nodePtr)->next)
{
list->tail = *nodePtr;
if(*nodePtr == obsoleteNode)
{
*nodePtr = &(*nodePtr)->next;
list->size--;
FREE(obsoleteNode);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment