summaryrefslogtreecommitdiff
path: root/driver_zodiac.c
diff options
context:
space:
mode:
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);
}