From 8c23b0e3ced6ba568703f5a01850bf70b3a17767 Mon Sep 17 00:00:00 2001 From: Arvid Norberg Date: Thu, 22 Sep 2011 21:24:50 +0000 Subject: [PATCH] allow NULL to be passed to create_torrent::set_comment and create_torrent::set_creator --- ChangeLog | 1 + src/create_torrent.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 97861b9e3..1f953eaae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -92,6 +92,7 @@ incoming connection * added more detailed instrumentation of the disk I/O thread + * allow NULL to be passed to create_torrent::set_comment and create_torrent::set_creator * fix UPnP issue for routers with multiple PPPoE connections * fix issue where event=stopped announces wouldn't be sent when closing session * fix possible hang in file::readv() on windows diff --git a/src/create_torrent.cpp b/src/create_torrent.cpp index b3b6a1013..089dff4c3 100644 --- a/src/create_torrent.cpp +++ b/src/create_torrent.cpp @@ -489,7 +489,8 @@ namespace libtorrent void create_torrent::set_comment(char const* str) { - m_comment = str; + if (str == 0) m_comment.clear(); + else m_comment = str; } void create_torrent::set_encryption_key(std::string const& key) @@ -499,7 +500,8 @@ namespace libtorrent void create_torrent::set_creator(char const* str) { - m_created_by = str; + if (str == 0) m_created_by.clear(); + else m_created_by = str; } }