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

Diff for /src/usr.bin/telnet/commands.c between version 1.83 and 1.84

version 1.83, 2016/03/16 15:41:11 version 1.84, 2016/05/03 02:06:54
Line 1445 
Line 1445 
   
                 gethostname(hbuf, sizeof hbuf);                  gethostname(hbuf, sizeof hbuf);
   
                 /* If this is not the full name, try to get it via DNS */  
                 if (strchr(hbuf, '.') == 0) {  
                         struct hostent *he = gethostbyname(hbuf);  
                         if (he != 0)  
                                 strncpy(hbuf, he->h_name, sizeof hbuf-1);  
                         hbuf[sizeof hbuf-1] = '\0';  
                 }  
   
                 if (asprintf (&cp, "%s%s", hbuf, cp2) == -1)                  if (asprintf (&cp, "%s%s", hbuf, cp2) == -1)
                         err(1, "asprintf");                          err(1, "asprintf");
   

Legend:
Removed from v.1.83  
changed lines
  Added in v.1.84