Author: oxygene Date: 2010-01-25 23:55:33 +0100 (Mon, 25 Jan 2010) New Revision: 882
Modified: trunk/flashrom.c Log: Open binary files in binary mode. No change on UNIX (or Mac OS, according to its documentation), but fixes operation on Windows.
Signed-off-by: Patrick Georgi patrick.georgi@coresystems.de Acked-by: Stefan Reinauer stepan@coresystems.de
Modified: trunk/flashrom.c =================================================================== --- trunk/flashrom.c 2010-01-23 15:15:19 UTC (rev 881) +++ trunk/flashrom.c 2010-01-25 22:55:33 UTC (rev 882) @@ -834,7 +834,7 @@ 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 @@ fprintf(stderr, "Continuing anyway.\n"); } } - if ((image = fopen(filename, "r")) == NULL) { + if ((image = fopen(filename, "rb")) == NULL) { perror(filename); programmer_shutdown(); exit(1);