author | tcunha <tcunha> | 2009-09-07 23:48:54 (GMT) |
---|---|---|
committer | tcunha <tcunha> | 2009-09-07 23:48:54 (GMT) |
commit | ead71bf7a517914387dae2a0b69c88bb817efb59 (patch) (side-by-side diff) | |
tree | d51874f5825da5ca37a3bc6297137409314ee882 /cmd-show-buffer.c | |
parent | c6ac50baf7afd01a5cd9bd691bc80b43759b11e4 (diff) | |
download | tmux-old-ead71bf7a517914387dae2a0b69c88bb817efb59.zip tmux-old-ead71bf7a517914387dae2a0b69c88bb817efb59.tar.gz tmux-old-ead71bf7a517914387dae2a0b69c88bb817efb59.tar.bz2 |
Sync OpenBSD patchset 318:
Give each paste buffer a size member instead of requiring them to be
zero-terminated.
-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 93d7dc2..b06128f 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 <[email protected]> @@ -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); |