mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
CmdJoin: Fix segment fault on join.
Code was attempting to dereference the end () iterator, which is invalid.
Since sets are already ordered, we can use the first and last element directly
instead of using the min/max functions.
Fixes a bug introduced in ( 8ce9e83ab5
"TI-93 #97 Make CLI::getIds() return a
set to guarantee uniqueness of ids" )
This commit is contained in:
parent
3780966ccd
commit
7c5503f962
1 changed files with 2 additions and 2 deletions
|
@ -62,8 +62,8 @@ int CmdJoin (
|
|||
|
||||
database.startTransaction ();
|
||||
|
||||
auto first_id = std::min (*ids.begin (), *ids.end ());
|
||||
auto second_id = std::max (*ids.begin (), *ids.end ());
|
||||
auto first_id = *ids.begin ();
|
||||
auto second_id = *ids.rbegin ();
|
||||
|
||||
Interval first = tracked[tracked.size () - first_id];
|
||||
Interval second = tracked[tracked.size () - second_id];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue