From 5b039a8982246859995b0e37d2c29ead1a89edef Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Mon, 30 Nov 2009 00:40:36 +0000 Subject: [PATCH] error handling in make_torrent --- examples/make_torrent.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/make_torrent.cpp b/examples/make_torrent.cpp index e5e9d1e85..1744e609e 100644 --- a/examples/make_torrent.cpp +++ b/examples/make_torrent.cpp @@ -140,6 +140,11 @@ int main(int argc, char* argv[]) std::string full_path = libtorrent::complete(argv[1]); add_files(fs, full_path, file_filter); + if (fs.num_files() == 0) + { + fputs("no files specified.\n", stderr); + return 1; + } create_torrent t(fs, piece_size, pad_file_limit, flags); for (std::vector::iterator i = trackers.begin()