From e12632548a71345acc0349ba9db1321cfa628911 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 29 Nov 2017 22:13:45 +1300 Subject: Fix TMG frame decoder --- src/org/traccar/protocol/TmgFrameDecoder.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/org/traccar/protocol/TmgFrameDecoder.java b/src/org/traccar/protocol/TmgFrameDecoder.java index 07b4162db..549c42466 100644 --- a/src/org/traccar/protocol/TmgFrameDecoder.java +++ b/src/org/traccar/protocol/TmgFrameDecoder.java @@ -47,13 +47,13 @@ public class TmgFrameDecoder extends FrameDecoder { } }); - if (beginIndex > 0) { + if (beginIndex >= 0) { buf.readerIndex(beginIndex); int endIndex = buf.indexOf(beginIndex, buf.writerIndex(), (byte) '\n'); - if (endIndex > 0) { + if (endIndex >= 0) { ChannelBuffer frame = buf.readBytes(endIndex - beginIndex); buf.readByte(); // delimiter return frame; -- cgit v1.2.3