1
0
mirror of https://github.com/asamy/ctorrent synced 2025-10-05 23:52:41 +02:00

purge unsafe_cast uses

This commit is contained in:
A. Samy
2015-11-14 06:25:12 +00:00
parent 83fa792aff
commit c77a5a4242
4 changed files with 35 additions and 37 deletions

View File

@@ -114,16 +114,9 @@ int main(int argc, char *argv[])
std::string file = files[i];
Torrent *t = &torrents[i];
try {
// yes, it won't throw exception in some cases... may sound bad but whatever
std::clog << "Opening: " << file << std::endl;
if (!t->open(file, dldir)) {
std::cerr << file << ": corrupted torrent file" << std::endl;
++errors;
continue;
}
} catch (const std::exception &e) {
std::cerr << file << ": failed to load torrent file: " << e.what() << std::endl;
std::clog << "Opening: " << file << std::endl;
if (!t->open(file, dldir)) {
std::cerr << file << ": corrupted torrent file" << std::endl;
++errors;
continue;
}