fix overflow issue in connection_tester

This commit is contained in:
Arvid Norberg 2012-01-31 05:59:01 +00:00
parent 8d7940d47e
commit cdd99857b9
1 changed files with 2 additions and 2 deletions

View File

@ -590,7 +590,7 @@ void generate_torrent(std::vector<char>& 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;