mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-18 22:47:21 -06:00
Null terminate the wide string in torrent creator.
This commit is contained in:
@@ -130,8 +130,9 @@ void TorrentCreatorThread::run() {
|
||||
// create the torrent and print it to out
|
||||
qDebug("Saving to %s", qPrintable(save_path));
|
||||
#ifdef _MSC_VER
|
||||
wchar_t *wsave_path = new wchar_t[save_path.length()];
|
||||
save_path.toWCharArray(wsave_path);
|
||||
wchar_t *wsave_path = new wchar_t[save_path.length()+1];
|
||||
int len = save_path.toWCharArray(wsave_path);
|
||||
wsave_path[len+1] = '\0';
|
||||
std::ofstream outfile(wsave_path, std::ios_base::out|std::ios_base::binary);
|
||||
delete[] wsave_path;
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user