commit - 5ab1e3c1bda423908dde9e027f496f9d25f5e4da
commit + fd29e8735f8d2276b3dce90c267f67742bc5bd06
blob - 440ceb6f9f2216d59433c6309e4acc4b13ff68f6
blob + 83bff426c3fc53cb1f21828c824714bebc25e481
--- ui.c
+++ ui.c
line_prefix_and_text(struct vline *vl, char *buf, size_t len,
const char **prfx_ret, const char **text_ret, int *text_len)
{
- int type, i, cont, width;
+ int type, cont;
+ size_t i, width;
char *space, *t;
if (vl->len == 0) {
if (cont) {
memset(buf, 0, len);
width = utf8_swidth_between(vl->parent->line, space);
- for (i = 0; i < width + 1; ++i)
- strlcat(buf, " ", len);
+ for (i = 0; i < width + 1 && i < len - 1; ++i)
+ buf[i] = ' ';
} else {
strlcpy(buf, vl->parent->line, len);
if ((t = strchr(buf, ' ')) != NULL)