/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. #include "lib_strbuf.h"
  6. #if defined(VMS)
  7. # include "ntp_fp.h"
  8. #endif
  9. #include "ntp_stdlib.h"
  10. #include "ntp_unixtime.h"
  11. char *
  12. utvtoa(
  13. const struct timeval *tv
  14. )
  15. {
  16. register char *buf;
  17. LIB_GETBUF(buf);
  18. (void) sprintf(buf, "%lu.%06lu", (u_long)tv->tv_sec,
  19. (u_long)tv->tv_usec);
  20. return buf;
  21. }