[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.32 and 1.33

version 1.32, 2001/08/02 21:00:14 version 1.33, 2001/08/25 21:50:13
Line 518 
Line 518 
   
                 /* Load ports sequentially */                  /* Load ports sequentially */
                 for (cp = lo; cp <= hi; cp++) {                  for (cp = lo; cp <= hi; cp++) {
                         portlist[x] = malloc(sizeof(PORT_MAX));                          portlist[x] = calloc(1, PORT_MAX);
                         sprintf(portlist[x], "%d", cp);                          sprintf(portlist[x], "%d", cp);
                         x++;                          x++;
                 }                  }
Line 539 
Line 539 
                 hi = (int)strtoul(p, &endp, 10);                  hi = (int)strtoul(p, &endp, 10);
                 if (hi <= 0 || hi > PORT_MAX || *endp != '\0')                  if (hi <= 0 || hi > PORT_MAX || *endp != '\0')
                         errx(1, "port range not valid");                          errx(1, "port range not valid");
                 portlist[0] = malloc(sizeof(PORT_MAX));                  portlist[0] = calloc(1, PORT_MAX);
                 portlist[0] = p;                  portlist[0] = p;
         }          }
 }  }

Legend:
Removed from v.1.32  
changed lines
  Added in v.1.33