X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fsptps.c;h=780014008a94a6983ab41618f746b7306ce51d5f;hb=ec1f7e525d046bcaeb8e7040b8cec9a34a568371;hp=ed1d952bbb48f94ab542f57dc5f44671084bd5d2;hpb=d1ec010660905ae0b99d783737350ccc08b37b16;p=meshlink diff --git a/src/sptps.c b/src/sptps.c index ed1d952b..78001400 100644 --- a/src/sptps.c +++ b/src/sptps.c @@ -436,7 +436,7 @@ static bool sptps_receive_data_datagram(sptps_t *s, const char *data, size_t len } else if (seqno < s->inseqno) { // If the sequence number is farther in the past than the bitmap goes, or if the packet was already received, drop it. if((s->inseqno >= s->replaywin * 8 && seqno < s->inseqno - s->replaywin * 8) || !(s->late[(seqno / 8) % s->replaywin] & (1 << seqno % 8))) { - fprintf(stderr, "Received late or replayed packet, seqno %d, last received %d", seqno, s->inseqno); + fprintf(stderr, "Received late or replayed packet, seqno %d, last received %d\n", seqno, s->inseqno); return false; } } else { @@ -508,7 +508,7 @@ bool sptps_receive_data(sptps_t *s, const char *data, size_t len) { s->buflen += toread; len -= toread; data += toread; - + // Exit early if we don't have the full length. if(s->buflen < 6) return true;