Changeset 7627


Ignore:
Timestamp:
Jan 6, 2009, 3:22:10 AM (12 years ago)
Author:
jhujhiti
Message:

(trunk libT) Fix an assertion failure in ptrarrays when values are equal.

This bug manifest itself due to a subtle change in tr_compareAddresses(), but
was always there. An assertion would fail if two (obviously adjacent) values
were equal.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/ptrarray.c

    r7582 r7627  
    107107int
    108108tr_ptrArrayInsert( tr_ptrArray * t,
    109                    void *        ptr,
     109                   void        * ptr,
    110110                   int           pos )
    111111{
     
    120120
    121121    memmove( t->items + pos + 1,
    122             t->items + pos,
    123             sizeof( void* ) * ( t->n_items - pos ) );
     122             t->items + pos,
     123             sizeof( void* ) * ( t->n_items - pos ) );
    124124
    125125    t->items[pos] = ptr;
     
    206206
    207207    for( i = 0; i < t->n_items - 2; ++i )
    208         assert( compare( t->items[i], t->items[i + 1] ) < 0 );
     208        assert( compare( t->items[i], t->items[i + 1] ) <= 0 );
    209209}
    210210
Note: See TracChangeset for help on using the changeset viewer.