summaryrefslogtreecommitdiff
path: root/libgps.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2005-08-17 18:46:11 +0000
committerEric S. Raymond <esr@thyrsus.com>2005-08-17 18:46:11 +0000
commit62606bbe2abe04d3acc30fd809124b711c9dfe48 (patch)
tree438e0e7db900297356e41fc0f9da9388245e82f0 /libgps.c
parent606c667f37b2202517905fab0e585171d4bc76a7 (diff)
downloadgpsd-62606bbe2abe04d3acc30fd809124b711c9dfe48.tar.gz
splint cleanup after integrating cgps.
Diffstat (limited to 'libgps.c')
-rw-r--r--libgps.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/libgps.c b/libgps.c
index 691e344c..a2a12cfe 100644
--- a/libgps.c
+++ b/libgps.c
@@ -46,7 +46,7 @@ enum unit gpsd_units(void)
{
char *envu = NULL;
- if ((envu = getenv("GPSD_UNITS")) && *envu) {
+ if ((envu = getenv("GPSD_UNITS")) != NULL && *envu != NULL) {
if (strcasecmp(envu, "imperial")) {
return imperial;
}
@@ -58,11 +58,11 @@ enum unit gpsd_units(void)
}
/* unrecognized, ignore it */
}
- if (((envu = getenv("LC_MEASUREMENT")) && *envu)
- || ((envu = getenv("LANG")) && *envu)) {
- if ( strstr(envu, "_US")
- || strcasecmp(envu, "C")
- || strcasecmp(envu, "POSIX")) {
+ if (((envu = getenv("LC_MEASUREMENT")) != NULL && *envu !=NULL)
+ || ((envu = getenv("LANG")) != NULL && *envu != NULL)) {
+ if (strstr(envu, "_US")!=0
+ || strcasecmp(envu, "C")!=0
+ || strcasecmp(envu, "POSIX")!=0) {
return imperial;
}
/* Other, must be metric */