From 7d1e2e2b2a2a2325bbd9c6f29d890ca88c8ab80f Mon Sep 17 00:00:00 2001 From: sledgehammer999 Date: Wed, 17 Oct 2012 19:21:27 +0300 Subject: [PATCH] Open stream in binary mode. Fixes issue #161 --- src/torrentcreator/torrentcreatorthread.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/torrentcreator/torrentcreatorthread.cpp b/src/torrentcreator/torrentcreatorthread.cpp index 043807b8a..caf488f64 100644 --- a/src/torrentcreator/torrentcreatorthread.cpp +++ b/src/torrentcreator/torrentcreatorthread.cpp @@ -129,7 +129,7 @@ void TorrentCreatorThread::run() { if (abort) return; // create the torrent and print it to out qDebug("Saving to %s", qPrintable(save_path)); - std::ofstream outfile(save_path.toLocal8Bit().constData()); + std::ofstream outfile(save_path.toLocal8Bit().constData(), std::ios_base::out|std::ios_base::binary); if (outfile.fail()) throw std::exception(); bencode(std::ostream_iterator(outfile), t.generate());