X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=ustd%2Flowlevel.c;h=65657490d6044d13ce3aa31aa1797d7637aab3ef;hb=54b7447337f23516c8249065a459372b4fdd9326;hp=d8d4cfa32c80cc83c1f11d456d24016ac6365289;hpb=1e8c9e7b5464b708572fe0d28f9d8bf572784e45;p=ust.git diff --git a/ustd/lowlevel.c b/ustd/lowlevel.c index d8d4cfa..6565749 100644 --- a/ustd/lowlevel.c +++ b/ustd/lowlevel.c @@ -91,7 +91,7 @@ void finish_consuming_dead_subbuffer(struct buffer_info *buf) } /* Iterate on subbuffers to recover. */ - for(i_subbuf=first_subbuf; ; i_subbuf++, i_subbuf %= buf->n_subbufs) { + for(i_subbuf = first_subbuf % buf->n_subbufs; ; i_subbuf++, i_subbuf %= buf->n_subbufs) { void *tmp; /* commit_seq is the offset in the buffer of the end of the last sequential commit. * Bytes beyond this limit cannot be recovered. This is a free-running counter. */