Changeset 7796


Ignore:
Timestamp:
Jan 25, 2009, 4:22:11 AM (12 years ago)
Author:
charles
Message:

(trunk libT) #1794: possible fix -- better handling of zero-size files

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/completion.c

    r7692 r7796  
    325325    const tr_file * file = &tor->info.files[fileIndex];
    326326    const tr_block_index_t firstBlock = file->offset / tor->blockSize;
    327     const tr_block_index_t lastBlock = ( file->offset + file->length - 1 ) / tor->blockSize;
     327    const tr_block_index_t lastBlock = file->length ? ( ( file->offset + file->length - 1 ) / tor->blockSize ) : firstBlock;
    328328
    329329    assert( tr_torBlockPiece( tor, firstBlock ) == file->firstPiece );
Note: See TracChangeset for help on using the changeset viewer.