diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2005-06-08 22:12:31 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2005-06-08 22:12:31 +0000 |
commit | 09760466ce8aab0173c3f087abae36b7fd2ca746 (patch) | |
tree | de9e8cf81643b824629ebebbd5a698b69a65a09e /sirfmon.c | |
parent | d117804adb3695d8e08d8e619ae9ebeeb831dae6 (diff) | |
download | gpsd-09760466ce8aab0173c3f087abae36b7fd2ca746.tar.gz |
Oops. Log the actual data, not random garbage off the buffer end.
Diffstat (limited to 'sirfmon.c')
-rw-r--r-- | sirfmon.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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; } |