diff --git a/retroshare-nogui/src/rpc/proto/rpcprotochat.cc b/retroshare-nogui/src/rpc/proto/rpcprotochat.cc index 1dfe166eb..1298206e5 100644 --- a/retroshare-nogui/src/rpc/proto/rpcprotochat.cc +++ b/retroshare-nogui/src/rpc/proto/rpcprotochat.cc @@ -1292,13 +1292,13 @@ bool fillLobbyInfoFromChatLobbyInfo(const ChatLobbyInfo &cli, rsctrl::chat::Chat lobby->set_last_activity(cli.last_activity); std::set::const_iterator pit; - for(pit = cli.participating_friends.begin(); pit != cli.participating_friends.begin(); pit++) + for(pit = cli.participating_friends.begin(); pit != cli.participating_friends.end(); pit++) { lobby->add_participating_friends(*pit); } std::map::const_iterator mit; - for(mit = cli.nick_names.begin(); mit != cli.nick_names.begin(); mit++) + for(mit = cli.nick_names.begin(); mit != cli.nick_names.end(); mit++) { lobby->add_nicknames(mit->first); } diff --git a/retroshare-nogui/src/rpc/proto/rpcprotosearch.cc b/retroshare-nogui/src/rpc/proto/rpcprotosearch.cc index ba15dd78d..77276ae12 100644 --- a/retroshare-nogui/src/rpc/proto/rpcprotosearch.cc +++ b/retroshare-nogui/src/rpc/proto/rpcprotosearch.cc @@ -634,7 +634,7 @@ bool condenseSearchResults(const std::list &searchResults, uint3 } unsigned int i = 0; - for(mit = searchMap.begin(); (mit != searchMap.end()) && (i < limit); mit++, i++) + for(mit = searchMap.begin(); (mit != searchMap.end()) && (i < limit || limit == 0); mit++, i++) { std::map::reverse_iterator nit; nit = mit->second.name_map.rbegin();