From 2309c25aa452bc419f476d36f0cad645e252bb6a Mon Sep 17 00:00:00 2001 From: sledgehammer999 Date: Sat, 26 Jan 2013 20:35:50 +0200 Subject: [PATCH] Fix null termination of wsave_path. --- 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 e8e91c03c..6bbaa8472 100644 --- a/src/torrentcreator/torrentcreatorthread.cpp +++ b/src/torrentcreator/torrentcreatorthread.cpp @@ -132,7 +132,7 @@ void TorrentCreatorThread::run() { #ifdef _MSC_VER wchar_t *wsave_path = new wchar_t[save_path.length()+1]; int len = save_path.toWCharArray(wsave_path); - wsave_path[len+1] = '\0'; + wsave_path[len] = '\0'; std::ofstream outfile(wsave_path, std::ios_base::out|std::ios_base::binary); delete[] wsave_path; #else