summaryrefslogtreecommitdiff
path: root/sirfmon.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2005-06-08 22:12:31 +0000
committerEric S. Raymond <esr@thyrsus.com>2005-06-08 22:12:31 +0000
commit09760466ce8aab0173c3f087abae36b7fd2ca746 (patch)
treede9e8cf81643b824629ebebbd5a698b69a65a09e /sirfmon.c
parentd117804adb3695d8e08d8e619ae9ebeeb831dae6 (diff)
downloadgpsd-09760466ce8aab0173c3f087abae36b7fd2ca746.tar.gz
Oops. Log the actual data, not random garbage off the buffer end.
Diffstat (limited to 'sirfmon.c')
-rw-r--r--sirfmon.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sirfmon.c b/sirfmon.c
index 985ce36a..62012a6e 100644
--- a/sirfmon.c
+++ b/sirfmon.c
@@ -767,6 +767,7 @@ static int readword(void)
static int readpkt(unsigned char *buf)
{
int byte,len,csum,cnt;
+ unsigned char *cp = buf;
do {
while ((byte = readbyte()) != START1)
@@ -783,7 +784,7 @@ static int readpkt(unsigned char *buf)
while (cnt-- > 0) {
if ((byte = readbyte()) == EOF)
return EOF;
- *buf++ = (unsigned char)byte;
+ *cp++ = (unsigned char)byte;
csum += byte;
}