diff --git a/libtorrent/src/torrent.cpp b/libtorrent/src/torrent.cpp index ce9e27f6..f6499a5e 100644 --- a/libtorrent/src/torrent.cpp +++ b/libtorrent/src/torrent.cpp @@ -913,8 +913,7 @@ namespace libtorrent { if( !m_picker ) return; - if( max_id < 0 ) - max_id = m_picker->last_have(); + max_id = std::min( max_id, m_picker->last_have() ); int piece_size = m_torrent_file->piece_size(0); diff --git a/src/twister.cpp b/src/twister.cpp index 8fa29502..740f23c0 100644 --- a/src/twister.cpp +++ b/src/twister.cpp @@ -1125,7 +1125,7 @@ Value getposts(const Array& params, bool fHelp) for( unsigned int u = 0; u < users.size(); u++ ) { Object user = users[u].get_obj(); string strUsername; - int max_id = -1; + int max_id = std::numeric_limits::max(); int since_id = -1; for (Object::const_iterator i = user.begin(); i != user.end(); ++i) {