diff options
author | 2009-09-07 18:50:45 +0000 | |
---|---|---|
committer | 2009-09-07 18:50:45 +0000 | |
commit | 1937104be15fbee565b8143bc2889ecd6b6206ac (patch) | |
tree | c627be8f36c02b47bb03757dd3c5d8627a7c1bd5 /usr.bin/tmux/cmd-show-buffer.c | |
parent | sync (diff) | |
download | wireguard-openbsd-1937104be15fbee565b8143bc2889ecd6b6206ac.tar.xz wireguard-openbsd-1937104be15fbee565b8143bc2889ecd6b6206ac.zip |
Give each paste buffer a size member instead of requiring them to be
zero-terminated.
Diffstat (limited to 'usr.bin/tmux/cmd-show-buffer.c')
-rw-r--r-- | usr.bin/tmux/cmd-show-buffer.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/usr.bin/tmux/cmd-show-buffer.c b/usr.bin/tmux/cmd-show-buffer.c index bff4d35ae6d..31dfc830727 100644 --- a/usr.bin/tmux/cmd-show-buffer.c +++ b/usr.bin/tmux/cmd-show-buffer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-show-buffer.c,v 1.5 2009/08/18 14:48:42 nicm Exp $ */ +/* $OpenBSD: cmd-show-buffer.c,v 1.6 2009/09/07 18:50:45 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -18,7 +18,6 @@ #include <sys/types.h> -#include <string.h> #include <vis.h> #include "tmux.h" @@ -65,7 +64,7 @@ cmd_show_buffer_exec(struct cmd *self, struct cmd_ctx *ctx) if (pb == NULL) return (0); - size = strlen(pb->data); + size = pb->size; if (size > SIZE_MAX / 4 - 1) size = SIZE_MAX / 4 - 1; in = xmalloc(size * 4 + 1); |