Fix loading too many states from a file
Jeffrey Pfau jeffrey@endrift.com
Sat, 19 Jul 2014 17:54:29 -0700
1 files changed,
6 insertions(+),
1 deletions(-)
jump to
M
src/gba/gba-rr.c
→
src/gba/gba-rr.c
@@ -85,7 +85,11 @@ if (!inputs) {
return false; } - struct GBARRBlock block; + struct GBARRBlock block = { + .next = 0, + .numInputs = GBA_RR_BLOCK_SIZE + }; + ssize_t read; do { read = inputs->read(inputs, block.inputs, sizeof(block.inputs));@@ -99,6 +103,7 @@ if (rr->currentBlock) {
rr->currentBlock->next = newBlock; } rr->currentBlock = newBlock; + newBlock->numInputs = read / sizeof(block.inputs[0]); } } while (read > 0);