summaryrefslogtreecommitdiffstats
path: root/flashrom.c
diff options
context:
space:
mode:
authorPatrick Georgi <patrick.georgi@coresystems.de>2010-01-25 22:55:33 +0000
committerPatrick Georgi <pgeorgi@google.com>2010-01-25 22:55:33 +0000
commit0bf842d0ca93919a1cad185de19c4621b6f194e6 (patch)
treed199f41d5ae12cce85b41d78988db6d551459e59 /flashrom.c
parent48da3f9f995514e6dd2ecf3ca713ff8b19750350 (diff)
downloadast2050-flashrom-0bf842d0ca93919a1cad185de19c4621b6f194e6.zip
ast2050-flashrom-0bf842d0ca93919a1cad185de19c4621b6f194e6.tar.gz
Open binary files in binary mode
No change on UNIX (or Mac OS, according to its documentation), but fixes operation on Windows. Corresponding to flashrom svn r882. Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de> Acked-by: Stefan Reinauer <stepan@coresystems.de>
Diffstat (limited to 'flashrom.c')
-rw-r--r--flashrom.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/flashrom.c b/flashrom.c
index c3e32a1..326f725 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -834,7 +834,7 @@ int read_flash(struct flashchip *flash, char *filename)
printf("Error: No filename specified.\n");
return 1;
}
- if ((image = fopen(filename, "w")) == NULL) {
+ if ((image = fopen(filename, "wb")) == NULL) {
perror(filename);
exit(1);
}
@@ -1154,7 +1154,7 @@ int doit(struct flashchip *flash, int force, char *filename, int read_it, int wr
fprintf(stderr, "Continuing anyway.\n");
}
}
- if ((image = fopen(filename, "r")) == NULL) {
+ if ((image = fopen(filename, "rb")) == NULL) {
perror(filename);
programmer_shutdown();
exit(1);
OpenPOWER on IntegriCloud