diff options
| -rw-r--r-- | url-mode.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -389,8 +389,11 @@ regex_detected(const struct terminal *term, enum url_action action, } /* Terminate the last line, if necessary */ - if (vline->len > 0 && vline->utf8[vline->len - 1] != '\0') + if (vline_idx < ALEN(vlines) && + vline->len > 0 && vline->utf8[vline->len - 1] != '\0') + { vline->utf8[vline->len++] = '\0'; + } for (size_t i = 0; i < ALEN(vlines); i++) { const struct vline *v = &vlines[i]; |
