summaryrefslogtreecommitdiff
path: root/net/ntop/patches/patch-af
blob: 04649de6541903c657b034b201a564e74de8a24f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
*** pbuf.c.orig	Tue Oct  6 03:49:59 1998
--- pbuf.c	Sun Oct 11 15:45:15 1998
***************
*** 265,270 ****
--- 265,271 ----
  void init_counters() {
    char *p;
    struct servent *svnt;
+   struct hostent *hent;
  
    (void)setsignal(SIGWINCH, windowSizeChanged);  
  
***************
*** 272,287 ****
     * The name of the local domain is now calculated properly
     * Kimmo Suominen <kim@tac.nyc.ny.us> 
     */
!   if((getdomainname(domainName, MAXHOSTNAMELEN) != 0) 
!      || (domainName[0] == '\0'))
!     {
!       if ((gethostname(domainName, MAXHOSTNAMELEN) == 0)
! 	  && ((p = memchr(domainName, '.', MAXHOSTNAMELEN)) != NULL)) {
  	domainName[MAXHOSTNAMELEN - 1] = '\0';
! 	memmove(domainName, ++p, MAXHOSTNAMELEN + domainName - p);
!       } else
! 	domainName[0] = '\0';
!     }
  
    init_curses();
    resetStats();
--- 273,290 ----
     * The name of the local domain is now calculated properly
     * Kimmo Suominen <kim@tac.nyc.ny.us> 
     */
!   if (gethostname(domainName, MAXHOSTNAMELEN) == 0) {
!     if ((p = memchr(domainName, '.', MAXHOSTNAMELEN)) != NULL) {
!       domainName[MAXHOSTNAMELEN - 1] = '\0';
!       memmove(domainName, ++p, MAXHOSTNAMELEN + domainName - p);
!     } else
!       if (((hent = gethostbyname(domainName)) != NULL)
! 	&& ((p = strchr(hent->h_name, '.')) != NULL)) {
! 	strncpy(domainName, ++p, MAXHOSTNAMELEN);
  	domainName[MAXHOSTNAMELEN - 1] = '\0';
!       }
!   } else
!     domainName[0] = '\0';
  
    init_curses();
    resetStats();