diff options
author | Tiago Cunha <tcunha@gmx.com> | 2009-09-07 23:48:54 +0000 |
---|---|---|
committer | Tiago Cunha <tcunha@gmx.com> | 2009-09-07 23:48:54 +0000 |
commit | c272de7cbafa343f0e2fc25beb66ed0b924f336f (patch) | |
tree | e44e3f1cc979078b853a0dd84a994b82128556f5 /cmd-show-buffer.c | |
parent | 5edc4658028b47d975f8685be63f5876a12a3a4f (diff) | |
download | rtmux-c272de7cbafa343f0e2fc25beb66ed0b924f336f.tar.gz rtmux-c272de7cbafa343f0e2fc25beb66ed0b924f336f.tar.bz2 rtmux-c272de7cbafa343f0e2fc25beb66ed0b924f336f.zip |
Sync OpenBSD patchset 318:
Give each paste buffer a size member instead of requiring them to be
zero-terminated.
Diffstat (limited to 'cmd-show-buffer.c')
-rw-r--r-- | cmd-show-buffer.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/cmd-show-buffer.c b/cmd-show-buffer.c index 58634f42..6ac8b1e8 100644 --- a/cmd-show-buffer.c +++ b/cmd-show-buffer.c @@ -1,4 +1,4 @@ -/* $Id: cmd-show-buffer.c,v 1.9 2009-08-20 11:35:16 tcunha Exp $ */ +/* $Id: cmd-show-buffer.c,v 1.10 2009-09-07 23:48:54 tcunha Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -18,8 +18,6 @@ #include <sys/types.h> -#include <string.h> - #include "tmux.h" /* @@ -64,7 +62,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); |