Problem with ILibLinkedList code, generated by IntelDevice builder

Problem with ILibLinkedList code, generated by IntelDevice builder

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)

2 posts / novo 0
Último post
Para obter mais informações sobre otimizações de compiladores, consulte Aviso sobre otimizações.

Hi,

This issue has already been resolved in version 2718 of the tools.

Deixar um comentário

Faça login para adicionar um comentário. Não é membro? Inscreva-se hoje mesmo!