summaryrefslogtreecommitdiff
path: root/packet.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2005-06-29 12:09:15 +0000
committerEric S. Raymond <esr@thyrsus.com>2005-06-29 12:09:15 +0000
commit70524d86debc58325f30a828b3ec95deb654ca21 (patch)
tree455e4310777327d94bf399a4fa77d46fc9fcc746 /packet.c
parente8491675ce9b228cb918805d5ba2e7837ca51108 (diff)
downloadgpsd-70524d86debc58325f30a828b3ec95deb654ca21.tar.gz
Make the test main of the packet getter work again.
Diffstat (limited to 'packet.c')
-rw-r--r--packet.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/packet.c b/packet.c
index dbf1bfab..d19e822e 100644
--- a/packet.c
+++ b/packet.c
@@ -37,6 +37,7 @@ distinguish them from baud barf.
#include <stdarg.h>
static int verbose = 0;
+static int waiting;
void gpsd_report(int errlevel, const char *fmt, ... )
/* assemble command in printf(3) style, use stderr or syslog */
@@ -769,7 +770,8 @@ int main(int argc, char *argv[])
state.inbuflen = 0;
memcpy(state.inbufptr = state.inbuffer, mp->test, mp->testlen);
gpsd_report(2, "%s starts with state %d\n", mp->legend, mp->initstate);
- st = packet_get(&state, mp->testlen);
+ waiting = mp->testlen;
+ st = packet_get(&state);
if (state.packet_type != mp->type)
printf("%s test FAILED (packet type %d wrong).\n", mp->legend, st);
else if (memcmp(mp->test + mp->garbage_offset, state.outbuffer, state.outbuflen))