Fix mark flattening

This commit is contained in:
Přemysl Eric Janouch 2017-01-18 00:34:49 +01:00
parent 52411d0a2e
commit cdb6f57a47
Signed by: p
GPG Key ID: B715679E3A361BE6
1 changed files with 3 additions and 3 deletions

6
hex.c
View File

@ -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)