diff options
author | Gary E. Miller <gem@rellim.com> | 2015-02-02 15:46:55 -0800 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2015-02-02 15:46:55 -0800 |
commit | b87323aac6ec6a4e12e813fa2214e8a480b77d13 (patch) | |
tree | e649b192c3b535e1757aa0ee6328deab1a588b3f /monitor_sirf.c | |
parent | b73abff012abacf770a9f59fb054b721e2b9e336 (diff) | |
download | gpsd-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.c | 1 |
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); |