uxn

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

commit ede10292d613c222cb4c1d0300bbe907a835e874
parent 8f75ec3801b46be00a46712a2b54de27c32ccab2
Author: Andrew Alderwick <andrew@alderwick.co.uk>
Date:   Sat,  6 Nov 2021 21:21:41 +0000

Add flush to File device writes

Diffstat:
Msrc/devices/file.c | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/devices/file.c b/src/devices/file.c @@ -114,8 +114,11 @@ file_write(void *src, Uint16 len, Uint8 flags) if((f = fopen(current_filename, (flags & 0x01) ? "ab" : "wb")) != NULL) state = FILE_WRITE; } - if(state == FILE_WRITE) - return fwrite(src, 1, len, f); + if(state == FILE_WRITE) { + Uint16 ret = fwrite(src, 1, len, f); + fflush(f); + return ret; + } return 0; }