summaryrefslogtreecommitdiff
path: root/packet.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2006-12-07 15:46:44 +0000
committerEric S. Raymond <esr@thyrsus.com>2006-12-07 15:46:44 +0000
commit4ff462037f6b660ab44cfef40644ec6899e7ebc6 (patch)
tree413213ceba7d7a82ca4acfbfe7033fe6684e7bc5 /packet.c
parent9ffbd7777a56287e6a7f79c303906da3d95b7bf9 (diff)
downloadgpsd-4ff462037f6b660ab44cfef40644ec6899e7ebc6.tar.gz
Fix a packet-sniffer bug in comment processing. With this, gpscat acquires
some new capabilities.
Diffstat (limited to 'packet.c')
-rw-r--r--packet.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/packet.c b/packet.c
index 35b7d17d..e65d709d 100644
--- a/packet.c
+++ b/packet.c
@@ -660,11 +660,10 @@ static void character_discard(struct gps_packet_t *lexer)
}
-/* entry points begin here */
-
/* get 0-origin big-endian words relative to start of packet buffer */
#define getword(i) (short)(lexer->inbuffer[2*(i)] | (lexer->inbuffer[2*(i)+1] << 8))
+/* entry points begin here */
ssize_t packet_parse(struct gps_packet_t *lexer, size_t fix)
/* grab a packet; returns either BAD_PACKET or the length */
@@ -700,6 +699,7 @@ ssize_t packet_parse(struct gps_packet_t *lexer, size_t fix)
else if (lexer->state == COMMENT_RECOGNIZED) {
packet_accept(lexer, COMMENT_PACKET);
packet_discard(lexer);
+ lexer->state = GROUND_STATE;
break;
}
#ifdef NMEA_ENABLE