summaryrefslogtreecommitdiffstats
path: root/cmd-save-buffer.c
diff options
context:
space:
mode:
authorTiago Cunha <tcunha@gmx.com>2009-09-07 23:48:54 +0000
committerTiago Cunha <tcunha@gmx.com>2009-09-07 23:48:54 +0000
commitc272de7cbafa343f0e2fc25beb66ed0b924f336f (patch)
treee44e3f1cc979078b853a0dd84a994b82128556f5 /cmd-save-buffer.c
parent5edc4658028b47d975f8685be63f5876a12a3a4f (diff)
Sync OpenBSD patchset 318:
Give each paste buffer a size member instead of requiring them to be zero-terminated.
Diffstat (limited to 'cmd-save-buffer.c')
-rw-r--r--cmd-save-buffer.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd-save-buffer.c b/cmd-save-buffer.c
index bcecd0c5..ca11bae4 100644
--- a/cmd-save-buffer.c
+++ b/cmd-save-buffer.c
@@ -1,4 +1,4 @@
-/* $Id: cmd-save-buffer.c,v 1.7 2009-07-28 22:12:16 tcunha Exp $ */
+/* $Id: cmd-save-buffer.c,v 1.8 2009-09-07 23:48:54 tcunha 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);