]> granicus.if.org Git - sudo/commitdiff
Truncate the buffer at buf.len before printing in the non-wordwrap case.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 14 Feb 2011 16:28:44 +0000 (11:28 -0500)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 14 Feb 2011 16:28:44 +0000 (11:28 -0500)
common/lbuf.c

index 5d7f687b89b149b6348669c7d0deaa96586de718..16e745e2e3caa2e7feb4823fe22d51f8f5ff2978 100644 (file)
@@ -218,6 +218,7 @@ lbuf_print(struct lbuf *lbuf)
 
     /* For very small widths just give up... */
     if (lbuf->cols <= lbuf->indent + contlen + 20) {
+       lbuf->buf[lbuf->len] = '\0';
        lbuf->output(lbuf->buf);
        goto done;
     }