MinGW: Use "b" in all fopen() calls.
This is required for proper operation on Windows/MinGW, and doesn't affect other OSes, most POSIX systems simply ignore the "b".
This commit is contained in:
parent
0f33365007
commit
45fdfa307d
|
@ -312,9 +312,9 @@ static int bin2bitbang(const char *filename,
|
||||||
int c, ret, bit, v;
|
int c, ret, bit, v;
|
||||||
uint32_t imm = 0x3f6df2ab;
|
uint32_t imm = 0x3f6df2ab;
|
||||||
|
|
||||||
f = fopen(filename, "r");
|
f = fopen(filename, "rb");
|
||||||
if (!f) {
|
if (!f) {
|
||||||
g_warning("fopen(\"%s\", \"r\")", filename);
|
g_warning("fopen(\"%s\", \"rb\")", filename);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ int ezusb_install_firmware(libusb_device_handle *hdl, const char *filename)
|
||||||
unsigned char buf[4096];
|
unsigned char buf[4096];
|
||||||
|
|
||||||
g_message("Uploading firmware at %s", filename);
|
g_message("Uploading firmware at %s", filename);
|
||||||
if ((fw = fopen(filename, "r")) == NULL) {
|
if ((fw = fopen(filename, "rb")) == NULL) {
|
||||||
g_warning("Unable to open firmware file %s for reading: %s",
|
g_warning("Unable to open firmware file %s for reading: %s",
|
||||||
filename, strerror(errno));
|
filename, strerror(errno));
|
||||||
return 1;
|
return 1;
|
||||||
|
|
Loading…
Reference in New Issue