From c92f527b600e3cc4e57db4f8e147d83f4311ac07 Mon Sep 17 00:00:00 2001 From: arvidn Date: Sat, 28 Jul 2018 08:42:33 +0200 Subject: [PATCH] in torrent_handle::id(), only shift down the pointer by 10 bits --- include/libtorrent/torrent_handle.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/libtorrent/torrent_handle.hpp b/include/libtorrent/torrent_handle.hpp index 99770a6a0..1af6e8327 100644 --- a/include/libtorrent/torrent_handle.hpp +++ b/include/libtorrent/torrent_handle.hpp @@ -1307,9 +1307,9 @@ namespace libtorrent boost::uint32_t id() const { uintptr_t ret = reinterpret_cast(m_torrent.lock().get()); - // a torrent object is about 1024 bytes, so - // it's safe to shift 11 bits - return boost::uint32_t(ret >> 11); + // a torrent object is about 1024 (2^10) bytes, so + // it's safe to shift 10 bits + return boost::uint32_t(ret >> 10); } // This function is intended only for use by plugins and the alert