summaryrefslogtreecommitdiff
path: root/driver_zodiac.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2013-10-26 13:33:55 -0400
committerEric S. Raymond <esr@thyrsus.com>2013-10-26 13:33:55 -0400
commit82df654227f83efab6610a896da96bc0008607f4 (patch)
tree423965c94ee24980196a530da923fad787710978 /driver_zodiac.c
parenta7a6fb3f33fa24ba7d538a6be1d4b7f898c72f32 (diff)
downloadgpsd-82df654227f83efab6610a896da96bc0008607f4.tar.gz
Cleanup fixes. There was a typo in the last change to the Zodiac driver.
All regression tests pass.
Diffstat (limited to 'driver_zodiac.c')
-rw-r--r--driver_zodiac.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/driver_zodiac.c b/driver_zodiac.c
index a62a4a99..ec93c13d 100644
--- a/driver_zodiac.c
+++ b/driver_zodiac.c
@@ -18,6 +18,7 @@
#endif /* S_SPLINT_S */
#include "gpsd.h"
+#include "bits.h"
/* Zodiac protocol description uses 1-origin indexing by little-endian word */
#define get16z(buf, n) ( (buf[2*(n)-2]) \
@@ -52,11 +53,10 @@ static int end_write(int fd, void *d, int len)
/* write an array of shorts in little-endian format */
{
char buf[BUFSIZ];
- char *p = buf;
short *data = (short *)d;
size_t n = (size_t)(len/2);
- for (n - 0; n < (size_t)(len/2); n++)
+ for (n = 0; n < (size_t)(len/2); n++)
putle16(buf, n*2, data[n]);
return write(fd, buf, len);
}