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.

16 lines
303 B

  1. #include "fmt.h"
  2. #include "ip4.h"
  3. unsigned int ip4_fmt(char *s,const char ip[4])
  4. {
  5. unsigned int len;
  6. int i;
  7. len = 0;
  8. for (i=0; i<4; ++i) {
  9. register unsigned int j;
  10. len+=(j=fmt_ulong(s,(unsigned long) (unsigned char) ip[i]))+1;
  11. if (s && i<3) { s+=i; *s++='.'; }
  12. }
  13. return len;
  14. }