Commit 0bf842d0 authored by Patrick Georgi's avatar Patrick Georgi Committed by Patrick Georgi
Browse files

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: default avatarPatrick Georgi <patrick.georgi@coresystems.de>
Acked-by: default avatarStefan Reinauer <stepan@coresystems.de>
parent 48da3f9f
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment