Changeset 1642


Ignore:
Timestamp:
Apr 3, 2007, 12:51:22 AM (15 years ago)
Author:
joshe
Message:

Fix benc list allocations for like the fourth time.
Hopefully this time it actually works.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/bencode.c

    r1639 r1642  
    4141
    4242    /* We need a bigger boat */
    43 
    44     len = val->val.l.alloc + ( count / LIST_SIZE ) +
    45         ( count % LIST_SIZE ? LIST_SIZE : 0 );
     43    len = val->val.l.alloc + count +
     44        ( count % LIST_SIZE ? LIST_SIZE - ( count % LIST_SIZE ) : 0 );
    4645    new = realloc( val->val.l.vals, len * sizeof( benc_val_t ) );
    4746    if( NULL == new )
Note: See TracChangeset for help on using the changeset viewer.