From cdb6f57a47cded5489e8e4e9bd595e651390a864 Mon Sep 17 00:00:00 2001
From: Přemysl Janouch
Date: Wed, 18 Jan 2017 00:34:49 +0100
Subject: Fix mark flattening
---
hex.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/hex.c b/hex.c
index 992fc72..5289bc5 100644
--- a/hex.c
+++ b/hex.c
@@ -462,12 +462,12 @@ app_flatten_marks (void)
closest = MIN (closest, current[i]->offset + current[i]->len);
// Remove from "current" marks that have ended
- for (size_t i = 0; i < current_len; i++)
- {
+ for (size_t i = 0; i < current_len; )
if (closest == current[i]->offset + current[i]->len)
memmove (current + i, current + i + 1,
(--current_len - i) * sizeof *current);
- }
+ else
+ i++;
// Add any new marks at "closest"
while (next < end && next->offset == closest)
--
cgit v1.2.3-70-g09d2