# HG changeset patch # User Mathieu Lacage # Date 1181054405 -7200 # Node ID 83a5df185d90f11c54c16a48e449ef7abe8c3ec4 # Parent e473844a60c22e8d398f515f6269ec4521945ebe fix the list iteration logic diff -r e473844a60c2 -r 83a5df185d90 src/common/packet-history.cc --- a/src/common/packet-history.cc Tue Jun 05 16:36:53 2007 +0200 +++ b/src/common/packet-history.cc Tue Jun 05 16:40:05 2007 +0200 @@ -991,7 +991,7 @@ { uint32_t totalSize = 0; uint16_t current = m_head; - uint16_t end = m_tail; + uint16_t tail = m_tail; while (current != 0xffff) { const uint8_t *buffer = &m_data->m_data[current]; @@ -1012,11 +1012,11 @@ fragmentEnd = item.size; } totalSize += fragmentEnd - fragmentStart; - current = item.next; - if (current == end) + if (current == tail) { break; } + current = item.next; } return totalSize; } @@ -1045,11 +1045,11 @@ struct PacketHistory::SmallItem item; uint32_t realSize = DoPrint (&item, buffer, data, offset, printer, os); offset += realSize; - current = item.next; if (current == tail) { break; } + current = item.next; } } else @@ -1064,11 +1064,11 @@ struct PacketHistory::SmallItem item; uint32_t realSize = DoPrint (&item, buffer, data, offset, printer, os); offset -= realSize; - current = item.prev; if (current == tail) { break; } + current = item.prev; } } }