aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakamichi Horikawa <takamichiho@gmail.com>2017-01-25 18:53:20 +0900
committerTakamichi Horikawa <takamichiho@gmail.com>2017-01-25 18:53:20 +0900
commit126f4858151487a2725c109f001c08ef8c59631e (patch)
tree5fa83fb82fb2390bb9f7aaa8cf7d82f3ece05745
parent1f8e53033ed15a3d460d53585b0803a4f55f6944 (diff)
fopen in binary mode for windows
-rw-r--r--curses/main.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/curses/main.c b/curses/main.c
index 6f362fa..3309e48 100644
--- a/curses/main.c
+++ b/curses/main.c
@@ -323,7 +323,7 @@ static bool readrom(struct opna *opna) {
path = dpath;
}
}
- FILE *rhythm = fopen(path, "r");
+ FILE *rhythm = fopen(path, "rb");
free(dpath);
if (!rhythm) goto err;
if (fseek(rhythm, 0, SEEK_END) != 0) goto err_file;
@@ -353,9 +353,9 @@ static FILE *pvisearch(const char *filename, const char *pvibase) {
*c += ('a' - 'A');
}
}
- FILE *pvifile = fopen(pviname, "r");
+ FILE *pvifile = fopen(pviname, "rb");
if (pvifile) return pvifile;
- pvifile = fopen(pviname_l, "r");
+ pvifile = fopen(pviname_l, "rb");
if (pvifile) return pvifile;
char *slash = strrchr(filename, '/');
if (!slash) return 0;
@@ -364,14 +364,14 @@ static FILE *pvisearch(const char *filename, const char *pvibase) {
memcpy(pvipath, filename, slash-filename+1);
pvipath[slash-filename+1] = 0;
strcat(pvipath, pviname);
- pvifile = fopen(pvipath, "r");
+ pvifile = fopen(pvipath, "rb");
if (pvifile) {
free(pvipath);
return pvifile;
}
pvipath[slash-filename+1] = 0;
strcat(pvipath, pviname_l);
- pvifile = fopen(pvipath, "r");
+ pvifile = fopen(pvipath, "rb");
if (pvifile) {
free(pvipath);
return pvifile;