mirror of
https://github.com/libretro/oberon-risc-emu.git
synced 2024-12-04 07:00:52 +00:00
Fix PCLink Receive for files sized a multiple of 255 bytes
Fix from Paul Reed: http://lists.inf.ethz.ch/pipermail/oberon/2017/010725.html
This commit is contained in:
parent
7217b49551
commit
3e6ff6c22c
@ -101,18 +101,18 @@ static uint32_t PCLink_RData(const struct RISC_Serial *serial) {
|
||||
}
|
||||
} else {
|
||||
int pos = (rxcount - fnlen - 1) % 256;
|
||||
if (pos == 0) {
|
||||
if (pos == 0 || flen == 0) {
|
||||
if (flen > 255) {
|
||||
ch = 255;
|
||||
} else {
|
||||
ch = (uint8_t)flen;
|
||||
if (flen == 0) {
|
||||
mode = 0; unlink(RecName);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
read(fd, &ch, 1);
|
||||
flen--;
|
||||
if (flen == 0) {
|
||||
mode = 0; unlink(RecName);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user