diff options
author | Přemysl Janouch <p.janouch@gmail.com> | 2017-01-18 00:34:49 +0100 |
---|---|---|
committer | Přemysl Janouch <p.janouch@gmail.com> | 2017-01-18 00:34:49 +0100 |
commit | cdb6f57a47cded5489e8e4e9bd595e651390a864 (patch) | |
tree | 9f32eb75c834fda5c1952de28e5cff9bbac65cd8 | |
parent | 52411d0a2e53933e7a15000414ff0b1b19fcf651 (diff) | |
download | hex-cdb6f57a47cded5489e8e4e9bd595e651390a864.tar.gz hex-cdb6f57a47cded5489e8e4e9bd595e651390a864.tar.xz hex-cdb6f57a47cded5489e8e4e9bd595e651390a864.zip |
Fix mark flattening
-rw-r--r-- | hex.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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) |