diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2012-09-04 13:24:51 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2012-09-04 13:24:51 +0000 |
commit | 7154763257ab1bce5cf7bb0065ea078cc5b9427e (patch) | |
tree | a83170753cafa6716546bfdc0852565548afa8e4 /usr.bin | |
parent | 29c866cacd0cf2eb540530217427cabfde86356d (diff) |
Trivial code simplification from Tim Ruehsen.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/tmux/paste.c | 8 |
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); } |