#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 04/22/10 at 06:17:32 by Chris Johns
Resolution: | → fixed |
---|---|
Status: | new → closed |
comment:2 Changed on 04/22/10 at 06:18:22 by Chris Johns
comment:3 Changed on 11/23/14 at 19:07:58 by Joel Sherrill
Description: | modified (diff) |
---|---|
Version: | unknown → 4.10 |
Note: See
TracTickets for help on using
tickets.
Closed.