1
1

tweaks: avoid the vague possibility of advancing beyond end-of-line

Like the other two fragments that advance over a zero-length match,
also this fragment should avoid the possibility of stepping beyond
the end of the line.
Этот коммит содержится в:
Benno Schulenberg 2021-01-24 17:03:22 +01:00
родитель 0508520b47
Коммит 7d3a555464

Просмотреть файл

@ -2524,6 +2524,8 @@ void draw_row(int row, const char *converted, linestruct *line, size_t from_col)
/* If the match has length zero, advance over it. */
if (match.rm_so == match.rm_eo) {
if (line->data[index] == '\0')
break;
index = step_right(line->data, index);
continue;
}