aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd-load-buffer.c4
-rw-r--r--cmd-save-buffer.c6
2 files changed, 5 insertions, 5 deletions
diff --git a/cmd-load-buffer.c b/cmd-load-buffer.c
index ab4c5c60..fd3387b0 100644
--- a/cmd-load-buffer.c
+++ b/cmd-load-buffer.c
@@ -1,4 +1,4 @@
-/* $Id: cmd-load-buffer.c,v 1.2 2009-01-27 23:26:15 nicm Exp $ */
+/* $Id: cmd-load-buffer.c,v 1.3 2009-05-18 16:22:30 nicm Exp $ */
/*
* Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org>
@@ -63,7 +63,7 @@ cmd_load_buffer_exec(struct cmd *self, struct cmd_ctx *ctx)
return (-1);
}
- if ((f = fopen(data->arg, "r")) == NULL) {
+ if ((f = fopen(data->arg, "rb")) == NULL) {
ctx->error(ctx, "%s: %s", data->arg, strerror(errno));
return (-1);
}
diff --git a/cmd-save-buffer.c b/cmd-save-buffer.c
index a2bc29cd..68b6f582 100644
--- a/cmd-save-buffer.c
+++ b/cmd-save-buffer.c
@@ -1,4 +1,4 @@
-/* $Id: cmd-save-buffer.c,v 1.4 2009-02-08 13:36:40 tcunha Exp $ */
+/* $Id: cmd-save-buffer.c,v 1.5 2009-05-18 16:22:30 nicm Exp $ */
/*
* Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org>
@@ -69,9 +69,9 @@ cmd_save_buffer_exec(struct cmd *self, struct cmd_ctx *ctx)
mask = umask(S_IRWXG | S_IRWXO);
if (data->flags & CMD_AFLAG)
- f = fopen(data->arg, "a");
+ f = fopen(data->arg, "ab");
else
- f = fopen(data->arg, "w");
+ f = fopen(data->arg, "wb");
if (f == NULL) {
ctx->error(ctx, "%s: %s", data->arg, strerror(errno));
return (-1);