From 42a220f9b8523e5e24cbe5446fc4e16d758abe34 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Wed, 3 Aug 2011 08:31:10 +0000 Subject: [PATCH] fixed bug in make torrents when saving merkle tree --- examples/make_torrent.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/make_torrent.cpp b/examples/make_torrent.cpp index 8c0bc9808..d6a43c676 100644 --- a/examples/make_torrent.cpp +++ b/examples/make_torrent.cpp @@ -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));