diff --git a/url-mode.c b/url-mode.c index 0101de19..6fd7f03a 100644 --- a/url-mode.c +++ b/url-mode.c @@ -368,7 +368,8 @@ regex_detected(const struct terminal *term, enum url_action action, vline->sz = new_size; } - vline->utf8[vline->len + j] = buf[j]; + vline->utf8[vline->len + j] = + (buf[j] == '\0') ? ' ' : buf[j]; vline->map[vline->len + j] = (struct coord){c, term->grid->view + r}; }