[BACK]Return to inet.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / netstat

Diff for /src/usr.bin/netstat/inet.c between version 1.3 and 1.4

version 1.3, 1996/06/26 05:37:21 version 1.4, 1997/01/17 07:12:57
Line 434 
Line 434 
         int width;          int width;
   
         sprintf(line, "%.*s.", (Aflag && !nflag) ? 12 : 16, inetname(in));          sprintf(line, "%.*s.", (Aflag && !nflag) ? 12 : 16, inetname(in));
         cp = index(line, '\0');          cp = strchr(line, '\0');
         if (!nflag && port)          if (!nflag && port)
                 sp = getservbyport((int)port, proto);                  sp = getservbyport((int)port, proto);
         if (sp || port == 0)          if (sp || port == 0)
Line 464 
Line 464 
         if (first && !nflag) {          if (first && !nflag) {
                 first = 0;                  first = 0;
                 if (gethostname(domain, MAXHOSTNAMELEN) == 0 &&                  if (gethostname(domain, MAXHOSTNAMELEN) == 0 &&
                     (cp = index(domain, '.')))                      (cp = strchr(domain, '.')))
                         (void) strcpy(domain, cp + 1);                          (void) strcpy(domain, cp + 1);
                 else                  else
                         domain[0] = 0;                          domain[0] = 0;
Line 482 
Line 482 
                 if (cp == 0) {                  if (cp == 0) {
                         hp = gethostbyaddr((char *)inp, sizeof (*inp), AF_INET);                          hp = gethostbyaddr((char *)inp, sizeof (*inp), AF_INET);
                         if (hp) {                          if (hp) {
                                 if ((cp = index(hp->h_name, '.')) &&                                  if ((cp = strchr(hp->h_name, '.')) &&
                                     !strcmp(cp + 1, domain))                                      !strcmp(cp + 1, domain))
                                         *cp = 0;                                          *cp = 0;
                                 cp = hp->h_name;                                  cp = hp->h_name;

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4