fix another case of uninitialized entry on bencode

This commit is contained in:
Miguel Freitas 2013-11-06 15:43:12 -02:00
parent 5b71538165
commit b470360bd5

View File

@ -164,11 +164,12 @@ int saveUserData(std::string const& filename, std::map<std::string,UserData> con
}
std::vector<char> buf;
if( users.size() ) {
if( userDict.type() == entry::dictionary_t ) {
bencode(std::back_inserter(buf), userDict);
return save_file(filename, buf);
} else {
return 0;
}
return save_file(filename, buf);
}