Riveting commentary

This commit is contained in:
XANTRONIX Development 2015-07-15 21:19:34 -05:00
parent 1cccfca835
commit e7b1c2cf54

View file

@ -210,10 +210,17 @@ ssize_t patty_kiss_tnc_recv(patty_kiss_tnc *tnc, void **frame, int *port) {
*/
memset(tnc->frame, '\0', tnc->bufsz);
/*
* Try to decode the TNC buffer into the packet.
*/
if ((decoded = tnc_decode(tnc, tnc->frame, &framelen, port)) < 0) {
goto error_io;
}
/*
* If we have decoded frame data, then flush the buffer up to the point of
* the next frame start, if present.
*/
if (decoded) {
tnc_flush(tnc, decoded);
}