~ubuntu-branches/ubuntu/jaunty/transmission/jaunty-security

« back to all changes in this revision

Viewing changes to libtransmission/completion.c

  • Committer: Bazaar Package Importer
  • Author(s): Philipp Benner
  • Date: 2007-11-22 12:37:14 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20071122123714-b0xi4zxhgk5qwbmc
Tags: 0.93.dfsg-2
* Added missing build-dependency (python).
* debian/control: switching to Homepage, Vcs-Browser and Vcs-Svn official
  fields (Leo "costela" Antunes)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/******************************************************************************
2
 
 * $Id: completion.c 3178 2007-09-26 01:55:04Z charles $
 
2
 * $Id: completion.c 3662 2007-10-31 04:23:50Z charles $
3
3
 *
4
4
 * Copyright (c) 2005 Transmission authors and contributors
5
5
 *
137
137
int
138
138
tr_cpPieceIsComplete( const tr_completion * cp, int piece )
139
139
{
140
 
    return cp->completeBlocks[piece] >= tr_torPieceCountBlocks(cp->tor,piece);
 
140
    assert( piece >= 0 );
 
141
    assert( piece < cp->tor->info.pieceCount );
 
142
    assert( cp->completeBlocks[piece] <= tr_torPieceCountBlocks(cp->tor,piece) );
 
143
 
 
144
    return cp->completeBlocks[piece] == tr_torPieceCountBlocks(cp->tor,piece);
141
145
}
142
146
 
143
147
const tr_bitfield * tr_cpPieceBitfield( const tr_completion * cp )