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

Diff for /src/usr.bin/nc/netcat.c between version 1.153 and 1.154

version 1.153, 2016/06/02 04:26:32 version 1.154, 2016/06/27 23:58:08
Line 144 
Line 144 
 int  int
 main(int argc, char *argv[])  main(int argc, char *argv[])
 {  {
         int ch, s, ret, socksv;          int ch, s = -1, ret, socksv;
         char *host, *uport;          char *host, *uport;
         struct addrinfo hints;          struct addrinfo hints;
         struct servent *sv;          struct servent *sv;
Line 158 
Line 158 
         struct tls *tls_ctx = NULL;          struct tls *tls_ctx = NULL;
   
         ret = 1;          ret = 1;
         s = 0;  
         socksv = 5;          socksv = 5;
         host = NULL;          host = NULL;
         uport = NULL;          uport = NULL;
Line 586 
Line 585 
                 build_ports(uport);                  build_ports(uport);
   
                 /* Cycle through portlist, connecting to each port. */                  /* Cycle through portlist, connecting to each port. */
                 for (i = 0; portlist[i] != NULL; i++) {                  for (s = -1, i = 0; portlist[i] != NULL; i++) {
                         if (s)                          if (s != -1)
                                 close(s);                                  close(s);
   
                         if (usetls) {                          if (usetls) {
Line 604 
Line 603 
                         else                          else
                                 s = remote_connect(host, portlist[i], hints);                                  s = remote_connect(host, portlist[i], hints);
   
                         if (s < 0)                          if (s == -1)
                                 continue;                                  continue;
   
                         ret = 0;                          ret = 0;
Line 653 
Line 652 
                 }                  }
         }          }
   
         if (s)          if (s != -1)
                 close(s);                  close(s);
   
         tls_config_free(tls_cfg);          tls_config_free(tls_cfg);

Legend:
Removed from v.1.153  
changed lines
  Added in v.1.154