summaryrefslogtreecommitdiff
path: root/gpsutils.c
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2015-02-12 12:49:25 -0800
committerGary E. Miller <gem@rellim.com>2015-02-12 12:51:36 -0800
commitcb75e02a7f2b1854f956e7fa0565dfc31c791dc9 (patch)
treeaf4486de56ffea3c903d6cb21025edc770459367 /gpsutils.c
parent55e648c97e6ad4d970ab58fbbcd004086e5c810e (diff)
downloadgpsd-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.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gpsutils.c b/gpsutils.c
index 8c9525ff..7184566a 100644
--- a/gpsutils.c
+++ b/gpsutils.c
@@ -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)
{