Changeset 12026


Ignore:
Timestamp:
Feb 24, 2011, 3:07:59 PM (11 years ago)
Author:
jordan
Message:

(2.2x) backport r11974 for #4047 "timeChecked for the last piece is not saved to a resume file"

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.2x/libtransmission/resume.c

    r11814 r12026  
    459459            tr_benc * ll = tr_bencListAddList( l, 2 + f->lastPiece - f->firstPiece );
    460460            tr_bencListAddInt( ll, offset );
    461             for( p=&inf->pieces[f->firstPiece], pend=&inf->pieces[f->lastPiece]; p!=pend; ++p )
     461            for( p=&inf->pieces[f->firstPiece], pend=&inf->pieces[f->lastPiece]+1; p!=pend; ++p )
    462462                tr_bencListAddInt( ll, p->timeChecked ? p->timeChecked - offset : 0 );
    463463        }
     
    513513                const tr_file * f = &inf->files[fi];
    514514                tr_piece * p = &inf->pieces[f->firstPiece];
    515                 const tr_piece * pend = &inf->pieces[f->lastPiece];
     515                const tr_piece * pend = &inf->pieces[f->lastPiece]+1;
    516516
    517517                if( tr_bencIsInt( b ) )
     
    534534                        int64_t t = 0;
    535535                        tr_bencGetInt( tr_bencListChild( b, i+1 ), &t );
    536                         inf->pieces[f->firstPiece+i].timeChecked = (time_t)(t + offset);
     536                        inf->pieces[f->firstPiece+i].timeChecked = (time_t)(t ? t + offset : 0);
    537537                    }
    538538                }
Note: See TracChangeset for help on using the changeset viewer.