mirror of https://github.com/mgba-emu/mgba.git
Fix loading too many states from a file
This commit is contained in:
parent
7172e6428c
commit
7d4f1fb661
|
@ -85,7 +85,11 @@ bool GBARRLoad(struct GBARRContext* rr, struct VDir* vdir) {
|
|||
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 @@ bool GBARRLoad(struct GBARRContext* rr, struct VDir* vdir) {
|
|||
rr->currentBlock->next = newBlock;
|
||||
}
|
||||
rr->currentBlock = newBlock;
|
||||
newBlock->numInputs = read / sizeof(block.inputs[0]);
|
||||
}
|
||||
} while (read > 0);
|
||||
|
||||
|
|
Loading…
Reference in New Issue