From 130b13522dfa013387fa2f2a2eacc38a6bad8fc2 Mon Sep 17 00:00:00 2001 From: David Brodsky Date: Sat, 1 Sep 2007 01:16:27 +0200 Subject: [PATCH] Fix peer id creation in Tairent::Main::TorrentManager::makeClientID(). --- src/main/torrentmanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/torrentmanager.cpp b/src/main/torrentmanager.cpp index 6081160..22ad273 100644 --- a/src/main/torrentmanager.cpp +++ b/src/main/torrentmanager.cpp @@ -283,7 +283,7 @@ void TorrentManager::makeClientID() std::ifstream f("/dev/urandom", std::ios_base::in); if (f.is_open()) { for (; i < 20; ++i) - clientID[i] = shadowTable[(char) f.get() % 64]; + clientID[i] = shadowTable[(unsigned int) f.get() % 64]; f.close(); } else { // cannot open /dev/urandom? fall back to standard random srandom(time(0)); -- 2.11.4.GIT