Fix patty_kiss_tnc_recv() reads less than bufsz
Fix issues with patty_kiss_tnc_recv() when read() calls return less than the allocated buffer size
This commit is contained in:
parent
c601e836fd
commit
b5ed9e9b61
1 changed files with 1 additions and 1 deletions
|
@ -136,7 +136,7 @@ ssize_t patty_kiss_tnc_recv(patty_kiss_tnc *tnc,
|
||||||
|
|
||||||
c = ((uint8_t *)tnc->buf)[tnc->offset++];
|
c = ((uint8_t *)tnc->buf)[tnc->offset++];
|
||||||
|
|
||||||
if (tnc->offset == tnc->bufsz) {
|
if (tnc->offset == tnc->readlen) {
|
||||||
tnc->offset = 0;
|
tnc->offset = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue