Fix conditional expression in pos_fetch, next non-macro definitions (cord)
authorIvan Maidanski <ivmai@mail.ru>
Wed, 26 Oct 2016 21:55:22 +0000 (00:55 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Wed, 26 Oct 2016 21:55:22 +0000 (00:55 +0300)
* 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

index 6db4ef2..38b1c95 100644 (file)
@@ -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);