Skip to content

Commit a0356b5

Browse files
author
nicm
committed
+b on fopen.
1 parent 578fe9d commit a0356b5

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

cmd-load-buffer.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $Id: cmd-load-buffer.c,v 1.2 2009-01-27 23:26:15 nicm Exp $ */
1+
/* $Id: cmd-load-buffer.c,v 1.3 2009-05-18 16:22:30 nicm Exp $ */
22

33
/*
44
* Copyright (c) 2009 Tiago Cunha <[email protected]>
@@ -63,7 +63,7 @@ cmd_load_buffer_exec(struct cmd *self, struct cmd_ctx *ctx)
6363
return (-1);
6464
}
6565

66-
if ((f = fopen(data->arg, "r")) == NULL) {
66+
if ((f = fopen(data->arg, "rb")) == NULL) {
6767
ctx->error(ctx, "%s: %s", data->arg, strerror(errno));
6868
return (-1);
6969
}

cmd-save-buffer.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* $Id: cmd-save-buffer.c,v 1.4 2009-02-08 13:36:40 tcunha Exp $ */
1+
/* $Id: cmd-save-buffer.c,v 1.5 2009-05-18 16:22:30 nicm Exp $ */
22

33
/*
44
* Copyright (c) 2009 Tiago Cunha <[email protected]>
@@ -69,9 +69,9 @@ cmd_save_buffer_exec(struct cmd *self, struct cmd_ctx *ctx)
6969

7070
mask = umask(S_IRWXG | S_IRWXO);
7171
if (data->flags & CMD_AFLAG)
72-
f = fopen(data->arg, "a");
72+
f = fopen(data->arg, "ab");
7373
else
74-
f = fopen(data->arg, "w");
74+
f = fopen(data->arg, "wb");
7575
if (f == NULL) {
7676
ctx->error(ctx, "%s: %s", data->arg, strerror(errno));
7777
return (-1);

0 commit comments

Comments
 (0)