Fix last piece length calculation for torrents > 2GB (ticket #361)

This commit is contained in:
zzz
2010-12-26 13:17:12 +00:00
parent b3d1a76146
commit cd0d062fca

View File

@ -291,7 +291,7 @@ public class MetaInfo
if (piece >= 0 && piece < pieces -1)
return piece_length;
else if (piece == pieces -1)
return (int)(length - piece * piece_length);
return (int)(length - ((long)piece * piece_length));
else
throw new IndexOutOfBoundsException("no piece: " + piece);
}