Author: alanmc
Date: 2008-02-19 18:53:37 -0500 (Tue, 19 Feb 2008)
New Revision: 96206
Modified:
trunk/bitsharp/src/MonoTorrent/MonoTorrent.Common/BitField.cs
Log:
Fixed off by one issue
Modified: trunk/bitsharp/src/MonoTorrent/MonoTorrent.Common/BitField.cs
===================================================================
--- trunk/bitsharp/src/MonoTorrent/MonoTorrent.Common/BitField.cs
2008-02-19 23:44:31 UTC (rev 96205)
+++ trunk/bitsharp/src/MonoTorrent/MonoTorrent.Common/BitField.cs
2008-02-19 23:53:37 UTC (rev 96206)
@@ -402,6 +402,8 @@
start = (start < startIndex) ? startIndex : start;
end = (end > this.length) ? this.length : end;
end = (end > endIndex) ? endIndex : end;
+ if (end == Length && end > 0)
+ end--;
for (int j = start; j <= end; j++)
if (Get(j)) // This piece is true
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches