From cdd99857b90028e38d4df8e1212338d508448944 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Tue, 31 Jan 2012 05:59:01 +0000 Subject: [PATCH] fix overflow issue in connection_tester --- examples/connection_tester.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/connection_tester.cpp b/examples/connection_tester.cpp index 6a368e8cb..ea29551ea 100644 --- a/examples/connection_tester.cpp +++ b/examples/connection_tester.cpp @@ -590,7 +590,7 @@ void generate_torrent(std::vector& buf, int size) size_type s = total_size; int i = 0; - int file_size = total_size / 9; + size_type file_size = total_size / 9; while (s > 0) { char buf[100]; @@ -697,7 +697,7 @@ int main(int argc, char* argv[]) { char file_name[100]; snprintf(file_name, sizeof(file_name), "%s-%d/file-%d", name, i, j); - fs.add_file(file_name, (j + i + 1) * 251); + fs.add_file(file_name, size_type(j + i + 1) * 251); } // 1 MiB piece size const int piece_size = 1024 * 1024;