From 59c760dfcd9da4ce2a4e5b68e66416f77b4d5e5f Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Tue, 4 Sep 2012 13:24:50 +0000 Subject: Trivial code simplification from Tim Ruehsen. --- paste.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'paste.c') diff --git a/paste.c b/paste.c index 3dcd6008..886231a2 100644 --- a/paste.c +++ b/paste.c @@ -162,10 +162,8 @@ paste_print(struct paste_buffer *pb, size_t width) len = width; used = strvisx(buf, pb->data, len, VIS_OCTAL|VIS_TAB|VIS_NL); - if (pb->size > width || used > width) { - buf[width - 3] = '\0'; - strlcat(buf, "...", width); - } + if (pb->size > width || used > width) + strlcpy(buf + width - 3, "...", 4); return (buf); } -- cgit