summaryrefslogtreecommitdiff
path: root/usr.bin/tmux
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2012-09-04 13:24:51 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2012-09-04 13:24:51 +0000
commit7154763257ab1bce5cf7bb0065ea078cc5b9427e (patch)
treea83170753cafa6716546bfdc0852565548afa8e4 /usr.bin/tmux
parent29c866cacd0cf2eb540530217427cabfde86356d (diff)
Trivial code simplification from Tim Ruehsen.
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r--usr.bin/tmux/paste.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/usr.bin/tmux/paste.c b/usr.bin/tmux/paste.c
index 2b0a0ac88a8..affdbe4070f 100644
--- a/usr.bin/tmux/paste.c
+++ b/usr.bin/tmux/paste.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: paste.c,v 1.12 2012/07/10 11:53:01 nicm Exp $ */
+/* $OpenBSD: paste.c,v 1.13 2012/09/04 13:24:50 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -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);
}