Skip to content

Commit

Permalink
tracker/udp: fix uninitialized variable
Browse files Browse the repository at this point in the history
  • Loading branch information
asamy committed Feb 12, 2017
1 parent 6ec34f2 commit a356ab0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ctorrent/tracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ bool Tracker::udpRequest(const TrackerQuery &r)
boost::asio::socket_base::non_blocking_io command(true);
socket.io_control(command);

int len;
int len = 0;
for (int tries = 0; tries < 10 && len != 16; ++tries) {
len = socket.receive_from(asio::buffer(buf, 16), r_endpoint, 0, error);
std::this_thread::sleep_for(std::chrono::milliseconds(tries * 30));
Expand Down
2 changes: 1 addition & 1 deletion main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ int main(int argc, char *argv[])
break;
default:
errors |= 1 << i;
std::cerr << "Failed" << std::endl;
std::cerr << "Failed: " << (int)state << std::endl;
break;
}
}
Expand Down

0 comments on commit a356ab0

Please sign in to comment.