summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@openbsd.org>2012-09-04 13:24:50 +0000
committerThomas Adam <thomas@xteddy.org>2012-09-04 22:37:31 +0100
commitb79f86e32a5f552680bc02d62d1c248522939491 (patch)
treee0b4ae7f0ad01cc24b9d0e158ad9252b28903067
parent40505e59f1a1762cb4b4e60fc0d1d657a4077655 (diff)
Trivial code simplification from Tim Ruehsen.
-rw-r--r--paste.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/paste.c b/paste.c
index b3e59562..78e7d8fa 100644
--- a/paste.c
+++ b/paste.c
@@ -161,10 +161,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);
}