diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/org/traccar/protocol/NvsFrameDecoder.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/NvsFrameDecoder.java b/src/org/traccar/protocol/NvsFrameDecoder.java index ce62ea867..3991a1865 100644 --- a/src/org/traccar/protocol/NvsFrameDecoder.java +++ b/src/org/traccar/protocol/NvsFrameDecoder.java @@ -34,9 +34,9 @@ public class NvsFrameDecoder extends FrameDecoder { int length; if (buf.getUnsignedByte(buf.readerIndex()) == 0) { - length = buf.getUnsignedShort(buf.readerIndex()); + length = 2 + buf.getUnsignedShort(buf.readerIndex()); } else { - length = 4 + buf.getUnsignedShort(buf.readerIndex() + 4) + 2; + length = 4 + 2 + buf.getUnsignedShort(buf.readerIndex() + 4) + 2; } if (buf.readableBytes() >= length) { |