diff options
author | Patrick Georgi <patrick.georgi@secunet.com> | 2012-09-20 13:26:42 +0200 |
---|---|---|
committer | Ronald G. Minnich <rminnich@gmail.com> | 2012-09-25 16:08:23 +0200 |
commit | 5c63761c378b14edf290c3f72e70a1d1d2709aae (patch) | |
tree | b4832f2323bcfee79e3945801709939141def329 /util/nvramtool | |
parent | cf329ffac87e6006d1c970b8b5800355048526a4 (diff) |
nvramtool: Read/write binary data as binary
Only relevant on windows (and nvramtool currently fails there), but
it doesn't hurt.
Change-Id: I5d6420c1f9dc49cf3af31e75088e51a90f729e01
Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com>
Reviewed-on: http://review.coreboot.org/1535
Tested-by: build bot (Jenkins)
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Diffstat (limited to 'util/nvramtool')
-rw-r--r-- | util/nvramtool/cli/nvramtool.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/util/nvramtool/cli/nvramtool.c b/util/nvramtool/cli/nvramtool.c index f3fb16d1b1..f283463f94 100644 --- a/util/nvramtool/cli/nvramtool.c +++ b/util/nvramtool/cli/nvramtool.c @@ -402,7 +402,7 @@ static void op_write_cmos_dump(void) unsigned char data[CMOS_SIZE]; FILE *f; - if ((f = fopen(nvramtool_op.param, "w")) == NULL) { + if ((f = fopen(nvramtool_op.param, "wb")) == NULL) { fprintf(stderr, "%s: Can not open file %s for writing: %s\n", prog_name, nvramtool_op.param, strerror(errno)); exit(1); @@ -434,7 +434,7 @@ static void op_read_cmos_dump(void) size_t nr_bytes; FILE *f; - if ((f = fopen(nvramtool_op.param, "r")) == NULL) { + if ((f = fopen(nvramtool_op.param, "rb")) == NULL) { fprintf(stderr, "%s: Can not open file %s for reading: %s\n", prog_name, nvramtool_op.param, strerror(errno)); exit(1); |