1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-24 11:29:10 +00:00
freebsd/usr.sbin/xntpd/lib/numtoa.c
1999-05-21 20:52:42 +00:00

23 lines
438 B
C

/*
* numtoa - return asciized network numbers store in local array space
*/
#include <stdio.h>
#include "ntp_fp.h"
#include "lib_strbuf.h"
#include "ntp_stdlib.h"
char *
numtoa(num)
u_int32_t num;
{
register u_int32_t netnum;
register char *buf;
netnum = ntohl(num);
LIB_GETBUF(buf);
(void) sprintf(buf, "%lu.%lu.%lu.%lu", (netnum >> 24) & 0xff,
(netnum >> 16) & 0xff, (netnum >> 8) & 0xff, netnum & 0xff);
return buf;
}