Fixed unsigned arithmetic

This commit is contained in:
Collin Smith 2020-06-22 02:13:14 -07:00
parent e831ca09cd
commit 8f0f2b36c6

View File

@ -119,7 +119,7 @@ public abstract class Packet {
return -1;
}
int sequenceDiff = bb.readUnsignedByte();
ack = (short) (sequence - sequenceDiff);
ack = (sequence - sequenceDiff) & 0xFFFF;
} else {
if (bb.readableBytes() < 2) {
logError("buffer too small for packet header (3)");