summaryrefslogtreecommitdiff
path: root/gpsd.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2005-06-21 15:42:15 +0000
committerEric S. Raymond <esr@thyrsus.com>2005-06-21 15:42:15 +0000
commit5b67be07a7037641a297aa26b3ff372a2219f08a (patch)
treeb574eec5f3f0e05928100f9cc58ded02e1ba2aad /gpsd.c
parent74f8080db9a337c8b04a8053c81d1034dcf03d05 (diff)
downloadgpsd-5b67be07a7037641a297aa26b3ff372a2219f08a.tar.gz
Simplest possible guard hook.
Diffstat (limited to 'gpsd.c')
-rw-r--r--gpsd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gpsd.c b/gpsd.c
index 82e877d1..1690bd1b 100644
--- a/gpsd.c
+++ b/gpsd.c
@@ -312,7 +312,7 @@ static void notify_watchers(struct gps_device_t *device, char *sentence, ...)
(void)throttled_write(cfd, buf, (ssize_t)strlen(buf));
}
-static void raw_hook(struct gps_data_t *ud UNUSED,
+static void raw_hook(struct gps_data_t *ud,
char *sentence, size_t len, int level)
/* hook to be executed on each incoming packet */
{
@@ -320,7 +320,7 @@ static void raw_hook(struct gps_data_t *ud UNUSED,
for (cfd = 0; cfd < FD_SETSIZE; cfd++) {
/* copy raw NMEA sentences from GPS to clients in raw mode */
- if (subscribers[cfd].raw == level && strcmp(ud->gps_device, (subscribers[cfd].device->gpsdata.gps_device))==0)
+ if (subscribers[cfd].raw == level && ud->gps_device!=NULL && strcmp(ud->gps_device, (subscribers[cfd].device->gpsdata.gps_device))==0)
(void)throttled_write(cfd, sentence, (ssize_t)len);
}
}