fixed bug in make torrents when saving merkle tree

This commit is contained in:
Arvid Norberg 2011-08-03 08:31:10 +00:00
parent 125041d2bf
commit 42a220f9b8
1 changed files with 2 additions and 2 deletions

View File

@ -212,8 +212,8 @@ int main(int argc, char* argv[])
if (!merklefile.empty())
{
output = fopen(merklefile.c_str(), "wb+");
int ret = fwrite(&t.merkle_tree()[0], 1, t.merkle_tree().size(), output);
if (ret != t.merkle_tree().size())
int ret = fwrite(&t.merkle_tree()[0], 20, t.merkle_tree().size(), output);
if (ret != t.merkle_tree().size() * 20)
{
fprintf(stderr, "failed to write %s: (%d) %s\n"
, merklefile.c_str(), errno, strerror(errno));