Mirror of :pserver:cvs@cvs.fefe.de:/cvs libowfat https://www.fefe.de/libowfat/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

15 lines
280 B

#include "fmt.h"
#include "ip4.h"
size_t fmt_ip4(char *s,const char ip[4])
{
size_t i,len;
len = 0;
for (i=0; i<4; ++i) {
register size_t j;
len+=(j=fmt_ulong(s,(unsigned long) (unsigned char) ip[i]))+1;
if (s && i<3) { s+=j; *s++='.'; }
}
return len-1;
}