diff options
author | Gary E. Miller <gem@rellim.com> | 2019-02-07 13:31:11 -0800 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2019-02-07 13:31:11 -0800 |
commit | 75fc3d837ad02a1befe5272ecd7657e41224bfea (patch) | |
tree | f6f43853d0accf12911fd3105d02cb1acacb63dd /gpsutils.c | |
parent | 9bbfa97c7094160e28086e16019370376874482b (diff) | |
download | gpsd-75fc3d837ad02a1befe5272ecd7657e41224bfea.tar.gz |
gpsutils: unix_to_iso8601() if fixtime is NaN, return NaN.
Diffstat (limited to 'gpsutils.c')
-rw-r--r-- | gpsutils.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -521,6 +521,9 @@ char *unix_to_iso8601(timestamp_t fixtime, char isotime[], size_t len) char timestr[30]; char fractstr[10]; + if (!isfinite(fixtime)) { + return "NaN"; + } fractional = modf(fixtime, &integral); /* snprintf rounding of %3f can get ugly, so pre-round */ if ( 0.999499999 < fractional) { |