Ignore:
Timestamp:
Jun 29, 2007, 2:53:12 AM (15 years ago)
Author:
charles
Message:

fix divide by zero bug in makemeta code, calculating number of pieces for a zero-sized file. (SoftwareElves?)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/makemeta.c

    r2206 r2229  
    162162
    163163    ret->pieceSize = bestPieceSize( ret->totalSize, ret->fileCount );
    164     ret->pieceCount = (int)( ret->totalSize / ret->pieceSize);
     164    ret->pieceCount = ret->pieceSize
     165        ? (int)( ret->totalSize / ret->pieceSize)
     166        : 0;
    165167    if( ret->totalSize % ret->pieceSize )
    166168        ++ret->pieceCount;
Note: See TracChangeset for help on using the changeset viewer.