summaryrefslogtreecommitdiff
path: root/gpsdclient.c
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2019-02-22 15:59:51 -0800
committerGary E. Miller <gem@rellim.com>2019-02-22 15:59:51 -0800
commitae2ebe25de183ddd576615fa80682d6d6a5b0ffe (patch)
treeae3af43ed4cacdeda551fc2b996df9eb7e9b0304 /gpsdclient.c
parentf1be39110e39e5c8d095200231a75aea3afecd57 (diff)
downloadgpsd-ae2ebe25de183ddd576615fa80682d6d6a5b0ffe.tar.gz
deg_to_s(): Add check, and regression test, for not a NaN.
Diffstat (limited to 'gpsdclient.c')
-rw-r--r--gpsdclient.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gpsdclient.c b/gpsdclient.c
index 1e585c74..b97acc03 100644
--- a/gpsdclient.c
+++ b/gpsdclient.c
@@ -53,7 +53,7 @@ char *deg_to_str(enum deg_str_type type, double f)
double fdsec, fsec, fdeg, fmin;
f = fabs(f);
- if (360.0 < f) {
+ if (!isfinite(f) || 360.0 < f) {
(void)strlcpy(str, "nan", sizeof(str));
return str;
}