/[inetutils]/inetutils/telnet/commands.c
ViewVC logotype

Diff of /inetutils/telnet/commands.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.16 by ams, Sun Jun 22 15:28:34 2003 UTC revision 1.17 by gray, Sun Aug 31 22:31:59 2003 UTC
# Line 2296  tn(int argc, char *argv[]) Line 2296  tn(int argc, char *argv[])
2296              sin.sin_addr.s_addr = temp;              sin.sin_addr.s_addr = temp;
2297              sin.sin_family = AF_INET;              sin.sin_family = AF_INET;
2298    
             if (_hostname)  
                 free (_hostname);  
             _hostname = malloc (strlen (hostp) + 1);  
             if (_hostname) {  
                 strcpy (_hostname, hostp);  
                 hostname = _hostname;  
             } else {  
                 printf ("Can't allocate memory to copy hostname\n");  
                 setuid(getuid());  
                 return 0;  
             }  
2299          } else {          } else {
2300              host = gethostbyname(hostp);              host = gethostbyname(hostp);
2301              if (host) {              if (host) {
# Line 2318  tn(int argc, char *argv[]) Line 2307  tn(int argc, char *argv[])
2307                  memmove((caddr_t)&sin.sin_addr, host->h_addr, host->h_length);                  memmove((caddr_t)&sin.sin_addr, host->h_addr, host->h_length);
2308  #endif  /* defined(h_addr) */  #endif  /* defined(h_addr) */
2309    
                 if (_hostname)  
                     free (_hostname);  
                 _hostname = malloc (strlen (host->h_name) + 1);  
                 if (_hostname) {  
                     strcpy (_hostname, host->h_name);  
                     hostname = _hostname;  
                 } else {  
                     printf ("Can't allocate memory to copy hostname\n");  
                     setuid(getuid());  
                     return 0;  
                 }  
             } else {  
                 herror(hostp);  
                 setuid(getuid());  
                 return 0;  
2310              }              }
2311          }          }
2312            if (_hostname)
2313                    free (_hostname);
2314            _hostname = malloc (strlen (hostp) + 1);
2315            if (_hostname) {
2316                    strcpy (_hostname, hostp);
2317                    hostname = _hostname;
2318            } else {
2319                    printf ("Can't allocate memory to copy hostname\n");
2320                    setuid(getuid());
2321                    return 0;
2322            }
2323  #if     defined(IP_OPTIONS) && defined(IPPROTO_IP)  #if     defined(IP_OPTIONS) && defined(IPPROTO_IP)
2324      }      }
2325  #endif  #endif

Legend:
Removed from v.1.16  
changed lines
  Added in v.1.17

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26