summaryrefslogtreecommitdiff
path: root/libgps_core.c
diff options
context:
space:
mode:
Diffstat (limited to 'libgps_core.c')
-rw-r--r--libgps_core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libgps_core.c b/libgps_core.c
index 3731f695..a326f4a3 100644
--- a/libgps_core.c
+++ b/libgps_core.c
@@ -57,7 +57,7 @@ int gps_open(/*@null@*/const char *host, /*@null@*/const char *port,
return -1;
#ifdef SHM_EXPORT_ENABLE
- if (strcmp(port, GPSD_SHARED_MEMORY) == 0) {
+ if (host != NULL && strcmp(host, GPSD_SHARED_MEMORY) == 0) {
status = gps_shm_open(gpsdata);
if (status == -1)
status = SHM_NOSHARED;