uxn

Varvara Ordinator, written in ANSI C(SDL2)
git clone https://git.eamoncaddigan.net/uxn.git
Log | Files | Refs | README | LICENSE

commit a6b99078decf1312040accaef88eaf8920743ace
parent 174ab66ddbcfb658f64645777bf687cec89f650a
Author: Andrew Alderwick <andrew@alderwick.co.uk>
Date:   Tue, 31 Aug 2021 19:30:46 +0100

Changed file_talk files to open in binary mode

Diffstat:
Msrc/uxncli.c | 2+-
Msrc/uxnemu.c | 2+-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/uxncli.c b/src/uxncli.c @@ -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) diff --git a/src/uxnemu.c b/src/uxnemu.c @@ -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)