summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/cmd-save-buffer.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2009-09-07 18:50:46 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2009-09-07 18:50:46 +0000
commita69d6b71f69b12c01a1ed0990c5f18cdb5b27483 (patch)
treee585fa2a6bbb8d7070e05e0feca593e98fd10564 /usr.bin/tmux/cmd-save-buffer.c
parent71bc7869f46d0ba653db9646b6ac592389a99d15 (diff)
Give each paste buffer a size member instead of requiring them to be
zero-terminated.
Diffstat (limited to 'usr.bin/tmux/cmd-save-buffer.c')
-rw-r--r--usr.bin/tmux/cmd-save-buffer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/tmux/cmd-save-buffer.c b/usr.bin/tmux/cmd-save-buffer.c
index 22ea1c48b00..a9462e72990 100644
--- a/usr.bin/tmux/cmd-save-buffer.c
+++ b/usr.bin/tmux/cmd-save-buffer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-save-buffer.c,v 1.3 2009/07/26 12:58:44 nicm Exp $ */
+/* $OpenBSD: cmd-save-buffer.c,v 1.4 2009/09/07 18:50:45 nicm Exp $ */
/*
* Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org>
@@ -75,7 +75,7 @@ cmd_save_buffer_exec(struct cmd *self, struct cmd_ctx *ctx)
return (-1);
}
- if (fwrite(pb->data, 1, strlen(pb->data), f) != strlen(pb->data)) {
+ if (fwrite(pb->data, 1, pb->size, f) != pb->size) {
ctx->error(ctx, "%s: fwrite error", data->arg);
fclose(f);
return (-1);