Open EM files in binary mode.

This commit is contained in:
David Given 2022-07-18 20:25:56 +02:00
parent 205a50d8ee
commit 7d112a394c
2 changed files with 6 additions and 6 deletions

View file

@ -153,7 +153,7 @@ static void argument(char *arg)
return; return;
} }
curfile = arg; /* for error messages etc. */ curfile = arg; /* for error messages etc. */
if ((ifile = fopen(arg, "r")) == NULL) if ((ifile = fopen(arg, "rb")) == NULL)
{ {
error("can't open %s", arg); error("can't open %s", arg);
return; return;
@ -385,10 +385,10 @@ void init_files(void)
* It has the nice property of generating truly unique names. * It has the nice property of generating truly unique names.
*/ */
tfile = fopen(tmpfil(), "w+"); tfile = fopen(tmpfil(), "wb+");
dfile = fopen(tmpfil(), "w+"); dfile = fopen(tmpfil(), "wb+");
rtfile = fopen(tmpfil(), "w+"); rtfile = fopen(tmpfil(), "wb+");
rdfile = fopen(tmpfil(), "w+"); rdfile = fopen(tmpfil(), "wb+");
} }
void initproc(void) void initproc(void)

View file

@ -127,7 +127,7 @@ void copyout(void)
if (remtext != 0) if (remtext != 0)
remtext = wordsize - remtext; remtext = wordsize - remtext;
if ((ifile = fopen(eout, "w")) == 0) if ((ifile = fopen(eout, "wb")) == 0)
fatal("can't create e.out"); fatal("can't create e.out");
rewind(tfile); rewind(tfile);