aboutsummaryrefslogtreecommitdiff
path: root/cube.c
diff options
context:
space:
mode:
authorBen Harris <bjh21@bjh21.me.uk>2023-04-02 20:58:30 +0100
committerBen Harris <bjh21@bjh21.me.uk>2023-04-02 21:17:11 +0100
commit8d3a93ce47237114a88d8bed81ab175994eb9a6b (patch)
tree11cc8a73420a072748e5acb3242c3539e1e1992f /cube.c
parent2499eb47fa4e0c86bc1b6100b4922026670b2ad8 (diff)
downloadpuzzles-8d3a93ce47237114a88d8bed81ab175994eb9a6b.zip
puzzles-8d3a93ce47237114a88d8bed81ab175994eb9a6b.tar.gz
puzzles-8d3a93ce47237114a88d8bed81ab175994eb9a6b.tar.bz2
puzzles-8d3a93ce47237114a88d8bed81ab175994eb9a6b.tar.xz
js: load games using FileReader.readAsArrayBuffer()
Using .readAsText() meant that trying to load a non-text file (for instance something that's not a save file at all) would generate an "RuntimeError: index out of bounds". This would then leave the Emscripten runtime in a broken state. It might even be possible for a real save file not to be valid UTF-8, for instance if it came from a platform that used a different character encoding for random seeds. There's still a problem with opening very large files, apparently because Emscripten tries to stuff the entire file onto the C stack. That will probably have to be fixed by properly exposing the incremental file-loading API to JavaScript.
Diffstat (limited to 'cube.c')
0 files changed, 0 insertions, 0 deletions