]> 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:50 +0000 (11:28 -0500)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 14 Feb 2011 16:28:50 +0000 (11:28 -0500)
--HG--
branch : 1.7

lbuf.c

diff --git a/lbuf.c b/lbuf.c
index a5e67bf915ccaf9a70d281762400ab302d057daf..d5adfdc1d705c207d5a56bdc0bceb0e995f325a0 100644 (file)
--- a/lbuf.c
+++ b/lbuf.c
@@ -286,6 +286,7 @@ lbuf_print(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;
     }