diff options
author | Gary E. Miller <gem@rellim.com> | 2015-02-12 12:49:25 -0800 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2015-02-12 12:51:36 -0800 |
commit | cb75e02a7f2b1854f956e7fa0565dfc31c791dc9 (patch) | |
tree | af4486de56ffea3c903d6cb21025edc770459367 /gpsutils.c | |
parent | 55e648c97e6ad4d970ab58fbbcd004086e5c810e (diff) | |
download | gpsd-cb75e02a7f2b1854f956e7fa0565dfc31c791dc9.tar.gz |
Document the output of timespec_str() better
It can be as short as 12 chars: "-0.123456789"
Or as long as 21 chars: "-2147483647.123456789"
Diffstat (limited to 'gpsutils.c')
-rw-r--r-- | gpsutils.c | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -489,6 +489,18 @@ double earth_distance(double lat1, double lon1, double lat2, double lon2) * put in it *buf, buf should be at least 22 bytes * return negative for error * otherwise the number of chars in buf, excluding trailing \0 + * + * the returned buffer will look like, shortest case: + * sign character ' ' or '-' + * one digit of seconds + * decmal point '.' + * 9 digits of nanoSec + * + * So 12 chars, like this: "-0.123456789" + * + * Absolute worst case is 10 digits of seconds. + * So 21 digits like this: "-2147483647.123456789" + * */ int timespec_str(struct timespec *ts, /*@out@*/char *buf, int buf_size) { |