From 8b22dc519ef87566762d5230cf610e6c14e780e5 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Thu, 27 Oct 2016 00:55:22 +0300 Subject: [PATCH] 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. --- cord/cordbscs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cord/cordbscs.c b/cord/cordbscs.c index d86111c2..277d1362 100644 --- a/cord/cordbscs.c +++ b/cord/cordbscs.c @@ -871,7 +871,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)); @@ -880,7 +880,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); -- 2.40.0