Bugfix: MemROMReaderWrite was not working for 1 byte length because it

would copy the current mem's byte into the source buffer instead of the
opposite way.
This commit is contained in:
Anonym271 2025-02-11 22:45:25 +01:00 committed by Jonas Küper
parent dfcd482933
commit 06bef8b560
1 changed files with 1 additions and 1 deletions

View File

@ -348,7 +348,7 @@ int MemROMReaderWrite(void * file, void * buffer, u32 size)
if(remain<todo)
todo = remain;
if(todo==1) *(u8*)buffer = ((u8*)mem.buf)[mem.pos];
if (todo == 1) ((u8*)mem.buf)[mem.pos] = *(u8*)buffer;
else memcpy((u8*)mem.buf + mem.pos,buffer, todo);
mem.pos += todo;
return todo;