diff options
author | 2012-09-04 13:24:50 +0000 | |
---|---|---|
committer | 2012-09-04 13:24:50 +0000 | |
commit | 416cec2412f5a60da99e0c977ce72713bb5d7de0 (patch) | |
tree | bf84d618445db490190776bf3ae829746229874a /usr.bin/tmux/paste.c | |
parent | Raise IPL to IPL_SOFTNET in nd6_addr_add(). This code originally ran at (diff) | |
download | wireguard-openbsd-416cec2412f5a60da99e0c977ce72713bb5d7de0.tar.xz wireguard-openbsd-416cec2412f5a60da99e0c977ce72713bb5d7de0.zip |
Trivial code simplification from Tim Ruehsen.
Diffstat (limited to 'usr.bin/tmux/paste.c')
-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); } |