- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi all
I have been developing a UPnP device, using the Intel UPnP device builder 'Build: 1.0.1868.18043'. In the developed code I am making use of the linked list support in ILibParsers.h. However I am not getting expected results if I remove the last element of the linked list. Attempting to add subsequent elements to the tail of the linked list then fail.
Below is the source to void ILibLinkedList_Remove(void *LinkedList_Node) as generated by device builder
void ILibLinkedList_Remove(void *LinkedList_Node) {
struct ILibLinkedListNode_Root *r = ((struct ILibLinkedListNode*)LinkedList_Node)->Root;
struct ILibLinkedListNode *n = (struct ILibLinkedListNode*) LinkedList_Node;
if(n->Previous!=NULL)
{
n->Previous->Next = n->Next;
}
if(n->Next!=NULL)
{
n->Next->Previous = n->Previous;
}
if(r->Head==n)
{
r->Head = n->Next;
}
if(r->Tail==n)
{
r->Tail = n->Next;
}
--r->count;
free(n);
}
The error appears to be in the check to see if this is the last element in the list. I believe it should be
if(r->Tail==n)
{
r->Tail = n->Previous;
}
Do people agree?
The same issue is also present in
void ILibLinkedList_Remove_ByData(void *LinkedList, void *data)
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
This issue has already been resolved in version 2718 of the tools.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page