summaryrefslogtreecommitdiff
path: root/gpsdclient.c
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2019-02-21 16:01:08 -0800
committerGary E. Miller <gem@rellim.com>2019-02-21 16:01:08 -0800
commit99835709b0f9bc8a39bf2736e78a2690dd636d4b (patch)
tree7800bdf12528b16323309f1467c85fe981c0dd87 /gpsdclient.c
parent0e4684abb7058f36eea60abba5124d019f9bc01b (diff)
downloadgpsd-99835709b0f9bc8a39bf2736e78a2690dd636d4b.tar.gz
deg_to_s(): Change test to yoda test. Comment need for rounding.
Diffstat (limited to 'gpsdclient.c')
-rw-r--r--gpsdclient.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gpsdclient.c b/gpsdclient.c
index 8ca605d4..c34ea06c 100644
--- a/gpsdclient.c
+++ b/gpsdclient.c
@@ -49,11 +49,12 @@ char *deg_to_str(enum deg_str_type type, double f)
int dsec, sec, deg, min;
double fdsec, fsec, fdeg, fmin;
- if (f < 0 || f > 360) {
+ if (0.0 > f || 360.0 < f) {
(void)strlcpy(str, "nan", sizeof(str));
return str;
}
+ /* FIXME: s/b rounding */
fmin = modf(f, &fdeg);
deg = (int)fdeg;