PageRenderTime 15ms CodeModel.GetById 9ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/contrib/ntp/libntp/utvtoa.c

https://bitbucket.org/freebsd/freebsd-head/
C | 26 lines | 18 code | 5 blank | 3 comment | 0 complexity | 467d07043b40c9235e8c4929d34c9958 MD5 | raw file
 1/*
 2 * utvtoa - return an asciized representation of an unsigned struct timeval
 3 */
 4#include <stdio.h>
 5
 6#include "lib_strbuf.h"
 7
 8#if defined(VMS)
 9# include "ntp_fp.h"
10#endif
11#include "ntp_stdlib.h"
12#include "ntp_unixtime.h"
13
14char *
15utvtoa(
16	const struct timeval *tv
17	)
18{
19	register char *buf;
20
21	LIB_GETBUF(buf);
22	
23	(void) sprintf(buf, "%lu.%06lu", (u_long)tv->tv_sec,
24		       (u_long)tv->tv_usec);
25	return buf;
26}