Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Willemt Raft
Commits
4b529e10
Commit
4b529e10
authored
Feb 01, 2016
by
Willem Thiart
Browse files
Fix: set n_etys to 0 when there are no logs
A regression caused by
a20e8592
.
parent
4209c302
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/raft_log.c
View file @
4b529e10
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment