#1504 closed defect (fixed)

Infinite loop on example

Reported by: Alin Rus Owned by: Chris Johns
Priority: normal Milestone: 4.10
Component: doc Version: 4.10
Severity: normal Keywords:
Cc: joel.sherrill@… Blocked By:
Blocking:

Description (last modified by Joel Sherrill)

The example in the following url is flawed http://www.rtems.org/onlinedocs//doc-current/share/rtems/html/c_user/c_user00514.html

The if checks if the strings are the same, if so if goes to the next node, otherwise it doesn't which is not a correct behavior.

This is an alternative way of correcting the code

while (!rtems_chain_is_tail (chain, node))
{

bar = (foo*) node;
rtems_chain_node* next_node = node->next;

if (strcmp (match, bar->data) == 0)
{

rtems_chain_extract (node);
rtems_chain_append (out, node);

}


node = next_node;

}

Change History (3)

comment:1 Changed on Apr 22, 2010 at 6:17:32 AM by Chris Johns

Resolution: fixed
Status: newclosed

comment:2 Changed on Apr 22, 2010 at 6:18:22 AM by Chris Johns

Closed.

comment:3 Changed on Nov 23, 2014 at 7:07:58 PM by Joel Sherrill

Description: modified (diff)
Version: unknown4.10
Note: See TracTickets for help on using tickets.