From 8f47ba50f19c2fa74b34b001902388b90edccc4b Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Sun, 14 Jun 2009 22:50:35 +0000 Subject: [PATCH] hash_for_slot fix --- src/storage.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/storage.cpp b/src/storage.cpp index 238844eca..1a373da0c 100644 --- a/src/storage.cpp +++ b/src/storage.cpp @@ -537,7 +537,7 @@ namespace libtorrent if (small_hash && small_piece_size < block_size) { - ph.h.update((char const*)buf.iov_base, small_piece_size); + if (small_piece_size > 0) ph.h.update((char const*)buf.iov_base, small_piece_size); *small_hash = hasher(ph.h).final(); small_hash = 0; // avoid this case again ph.h.update((char const*)buf.iov_base + small_piece_size