From: Ivan Maidanski Date: Wed, 26 Oct 2016 21:55:22 +0000 (+0300) Subject: Fix conditional expression in pos_fetch, next non-macro definitions (cord) X-Git-Tag: v8.0.0~1067 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b97e18ce5726ceff1e0a55ebe296fe89f411b347;p=gc Fix conditional expression in pos_fetch, next non-macro definitions (cord) * cord/cordbscs.c (CORD_pos_fetch, CORD_next): Match the conditional expression of the macro definition (of the same name) in cord_pos.h. --- diff --git a/cord/cordbscs.c b/cord/cordbscs.c index 6db4ef27..38b1c958 100644 --- a/cord/cordbscs.c +++ b/cord/cordbscs.c @@ -875,7 +875,7 @@ void CORD__prev(register CORD_pos p) char CORD_pos_fetch(register CORD_pos p) { - if (p[0].cur_start <= p[0].cur_pos && p[0].cur_pos < p[0].cur_end) { + if (p[0].cur_end != 0) { return(p[0].cur_leaf[p[0].cur_pos - p[0].cur_start]); } else { return(CORD__pos_fetch(p)); @@ -884,7 +884,7 @@ char CORD_pos_fetch(register CORD_pos p) void CORD_next(CORD_pos p) { - if (p[0].cur_pos < p[0].cur_end - 1) { + if (p[0].cur_pos + 1 < p[0].cur_end) { p[0].cur_pos++; } else { CORD__next(p);