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; } }