From 10a1468676f76c8e014979f006334bbbaadddf3b Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Thu, 16 Apr 2020 18:04:35 -0700 Subject: [PATCH] ircd::m::room::origins: Fix bug causing repeated last result. --- matrix/room_origins.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/matrix/room_origins.cc b/matrix/room_origins.cc index 52db5d185..844fbb675 100644 --- a/matrix/room_origins.cc +++ b/matrix/room_origins.cc @@ -269,10 +269,11 @@ const { assert(!last.empty()); assert(last.size() < sizeof(lastbuf)); + repeat = 0; lastbuf[last.size() - 1]++; char keybuf[dbs::ROOM_JOINED_KEY_MAX_SIZE]; - seek(it, dbs::room_joined_key(keybuf, room.room_id, last)); - repeat = 0; + if(!seek(it, dbs::room_joined_key(keybuf, room.room_id, last))) + break; } }