summaryrefslogtreecommitdiff
path: root/monitor_sirf.c
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2015-02-02 15:46:55 -0800
committerGary E. Miller <gem@rellim.com>2015-02-02 15:46:55 -0800
commitb87323aac6ec6a4e12e813fa2214e8a480b77d13 (patch)
treee649b192c3b535e1757aa0ee6328deab1a588b3f /monitor_sirf.c
parentb73abff012abacf770a9f59fb054b721e2b9e336 (diff)
downloadgpsd-b87323aac6ec6a4e12e813fa2214e8a480b77d13.tar.gz
Comment possible numeric overflow in timespec_diff_ns()
timespec_diff_ns() should not be used is the delta is more than about 2 seconds.
Diffstat (limited to 'monitor_sirf.c')
-rw-r--r--monitor_sirf.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/monitor_sirf.c b/monitor_sirf.c
index 0a17691e..6a2303ac 100644
--- a/monitor_sirf.c
+++ b/monitor_sirf.c
@@ -590,6 +590,7 @@ static void sirf_update(void)
/*@-compdef@*/
/*@-type@*/ /* splint is confused about struct timespec */
if (pps_thread_lastpps(&session, &drift) > 0) {
+ /* WARNING! this will fail if timedelta more than a few seconds */
double timedelta = timespec_diff_ns(drift.real, drift.clock) * 1e-9;
display(mid7win, 2, 39, "%.9f", timedelta); /* PPS offset */
(void)wnoutrefresh(mid7win);