0
0
Fork 0
mirror of https://git.sr.ht/~rabbits/uxn synced 2024-11-23 22:35:11 +00:00

Changed file_talk files to open in binary mode

This commit is contained in:
Andrew Alderwick 2021-08-31 19:30:46 +01:00
parent 174ab66ddb
commit a6b99078de
2 changed files with 2 additions and 2 deletions

View file

@ -81,7 +81,7 @@ file_talk(Device *d, Uint8 b0, Uint8 w)
Uint16 result = 0, length = peek16(d->dat, 0xa);
long offset = (peek16(d->dat, 0x4) << 16) + peek16(d->dat, 0x6);
Uint16 addr = peek16(d->dat, b0 - 1);
FILE *f = fopen(name, read ? "r" : (offset ? "a" : "w"));
FILE *f = fopen(name, read ? "rb" : (offset ? "ab" : "wb"));
if(f) {
fprintf(stderr, "%s %s %s #%04x, ", read ? "Loading" : "Saving", name, read ? "to" : "from", addr);
if(fseek(f, offset, SEEK_SET) != -1)

View file

@ -346,7 +346,7 @@ file_talk(Device *d, Uint8 b0, Uint8 w)
Uint16 result = 0, length = peek16(d->dat, 0xa);
long offset = (peek16(d->dat, 0x4) << 16) + peek16(d->dat, 0x6);
Uint16 addr = peek16(d->dat, b0 - 1);
FILE *f = fopen(name, read ? "r" : (offset ? "a" : "w"));
FILE *f = fopen(name, read ? "rb" : (offset ? "ab" : "wb"));
if(f) {
fprintf(stderr, "%s %s %s #%04x, ", read ? "Loading" : "Saving", name, read ? "to" : "from", addr);
if(fseek(f, offset, SEEK_SET) != -1)