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_ubx.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_ubx.c')
-rw-r--r-- | monitor_ubx.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/monitor_ubx.c b/monitor_ubx.c index 15eef106..ae35b096 100644 --- a/monitor_ubx.c +++ b/monitor_ubx.c @@ -257,6 +257,7 @@ static void ubx_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; (void)mvwprintw(ppswin, 1, 13, "%.9f", timedelta); (void)wnoutrefresh(ppswin); |