diff --git a/examples/client_test.cpp b/examples/client_test.cpp index 18cb0275e..b95fe8479 100644 --- a/examples/client_test.cpp +++ b/examples/client_test.cpp @@ -479,10 +479,7 @@ void add_torrent(libtorrent::session& ses { using namespace libtorrent; - std::ifstream in(torrent.c_str(), std::ios_base::binary); - in.unsetf(std::ios_base::skipws); - entry e = bdecode(std::istream_iterator(in), std::istream_iterator()); - boost::intrusive_ptr t(new torrent_info(e)); + boost::intrusive_ptr t(new torrent_info(torrent.c_str())); std::cout << t->name() << "\n"; diff --git a/examples/simple_client.cpp b/examples/simple_client.cpp index 51d1eab22..fb16570da 100644 --- a/examples/simple_client.cpp +++ b/examples/simple_client.cpp @@ -60,11 +60,7 @@ int main(int argc, char* argv[]) { session s; s.listen_on(std::make_pair(6881, 6889)); - - std::ifstream in(argv[1], std::ios_base::binary); - in.unsetf(std::ios_base::skipws); - entry e = bdecode(std::istream_iterator(in), std::istream_iterator()); - s.add_torrent(torrent_info(e), "./"); + s.add_torrent(torrent_info(argv[1]), "./"); // wait for the user to end char a;