diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2006-12-07 15:46:44 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2006-12-07 15:46:44 +0000 |
commit | 4ff462037f6b660ab44cfef40644ec6899e7ebc6 (patch) | |
tree | 413213ceba7d7a82ca4acfbfe7033fe6684e7bc5 /packet.c | |
parent | 9ffbd7777a56287e6a7f79c303906da3d95b7bf9 (diff) | |
download | gpsd-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.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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 |