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

main: fix segfault

This commit is contained in:
A. Samy
2016-03-10 17:17:22 +00:00
parent 94c1e076b0
commit 796a72e102

View File

@@ -211,14 +211,16 @@ int main(int argc, char *argv[])
#endif
if (!nodownload && started > 0) {
while (!(total_bits & (completed | errors))) {
Torrent *t = &torrents[completed];
if (t->isFinished()) {
t->finish();
++completed;
} else {
t->checkTrackers();
if (!noseed)
t->nextConnection();
for (size_t i = 0; i < total; ++i) {
Torrent *t = &torrents[i];
if (t->isFinished()) {
t->finish();
completed |= 1 << i;
} else {
t->checkTrackers();
if (!noseed)
t->nextConnection();
}
}
Connection::poll();