diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2005-06-21 15:42:15 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2005-06-21 15:42:15 +0000 |
commit | 5b67be07a7037641a297aa26b3ff372a2219f08a (patch) | |
tree | b574eec5f3f0e05928100f9cc58ded02e1ba2aad /gpsd.c | |
parent | 74f8080db9a337c8b04a8053c81d1034dcf03d05 (diff) | |
download | gpsd-5b67be07a7037641a297aa26b3ff372a2219f08a.tar.gz |
Simplest possible guard hook.
Diffstat (limited to 'gpsd.c')
-rw-r--r-- | gpsd.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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); } } |