Sync usage with man page.
[netbsd-mini2440.git] / dist / ntp / libntp / numtoa.c
blobe55be184701cb59816c5b29d1013b6c6f2500e87
1 /* $NetBSD$ */
3 /*
4 * numtoa - return asciized network numbers store in local array space
5 */
6 #include <stdio.h>
8 #include "ntp_fp.h"
9 #include "lib_strbuf.h"
10 #include "ntp_stdlib.h"
12 char *
13 numtoa(
14 u_int32 num
17 register u_int32 netnum;
18 register char *buf;
20 netnum = ntohl(num);
21 LIB_GETBUF(buf);
22 (void) sprintf(buf, "%lu.%lu.%lu.%lu", ((u_long)netnum >> 24) & 0xff,
23 ((u_long)netnum >> 16) & 0xff, ((u_long)netnum >> 8) & 0xff,
24 (u_long)netnum & 0xff);
25 return buf;