Commit 4b529e10 authored by Willem Thiart's avatar Willem Thiart
Browse files

Fix: set n_etys to 0 when there are no logs

A regression caused by a20e8592.
parent 4209c302
...@@ -111,7 +111,10 @@ raft_entry_t* log_get_from_idx(log_t* me_, int idx, int *n_etys) ...@@ -111,7 +111,10 @@ raft_entry_t* log_get_from_idx(log_t* me_, int idx, int *n_etys)
assert(0 <= idx - 1); assert(0 <= idx - 1);
if (me->base + me->count < idx || idx < me->base) if (me->base + me->count < idx || idx < me->base)
{
*n_etys = 0;
return NULL; return NULL;
}
/* idx starts at 1 */ /* idx starts at 1 */
idx -= 1; idx -= 1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment