home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume14 / 3bconnect / ipaddr.c < prev    next >
C/C++ Source or Header  |  1988-05-08  |  466b  |  20 lines

  1. /*
  2.  * Copyright (C) 1988 Dave Settle. All rights reserved.
  3.  * Permission is granted to use, copy and modify this software, providing
  4.  * that it is not sold for profit, and that this copyright notice is retained
  5.  * in any copies of the source.
  6.  */
  7. /*
  8.  * ipaddr: print address as xx.xx.xx.xx.xx.xx
  9.  */
  10. char *ipaddr(a)
  11. char *a;
  12. {
  13.     register int i;
  14.     static char s[26];
  15.     for(i=0;i<5;i++) sprintf(s + (i * 3), "%02x.", a[i]);
  16.     sprintf(s + 15, "%02x", a[5]);
  17.     return(s);
  18. }
  19.  
  20.