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

Diff for /src/usr.bin/ftp/cmds.c between version 1.35 and 1.36

version 1.35, 2000/12/24 00:29:00 version 1.36, 2001/06/26 23:43:59
Line 937 
Line 937 
                                 gateport = strdup(argv[2]);                                  gateport = strdup(argv[2]);
 #endif  #endif
                         }                          }
                         strncpy(gsbuf, argv[1], sizeof(gsbuf) - 1);                          strlcpy(gsbuf, argv[1], sizeof(gsbuf));
                         gsbuf[sizeof(gsbuf) - 1] = '\0';  
                         gateserver = gsbuf;                          gateserver = gsbuf;
                         gatemode = 1;                          gatemode = 1;
                 }                  }
Line 1286 
Line 1285 
                 if (namep == NULL)                  if (namep == NULL)
                         namep = shell;                          namep = shell;
                 shellnam[0] = '-';                  shellnam[0] = '-';
                 (void)strncpy(shellnam + 1, ++namep, sizeof(shellnam) - 2);                  (void)strlcpy(shellnam + 1, ++namep, sizeof(shellnam) - 1);
                 shellnam[sizeof(shellnam) - 1] = '\0';  
                 if (strcmp(namep, "sh") != 0)                  if (strcmp(namep, "sh") != 0)
                         shellnam[0] = '+';                          shellnam[0] = '+';
                 if (debug) {                  if (debug) {
Line 1496 
Line 1494 
         int i, len;          int i, len;
         char buf[BUFSIZ];               /* must be >= sizeof(line) */          char buf[BUFSIZ];               /* must be >= sizeof(line) */
   
         (void)strncpy(buf, initial, sizeof(buf) - 1);          (void)strlcpy(buf, initial, sizeof(buf));
         buf[sizeof(buf) - 1] = '\0';  
         if (argc > 1) {          if (argc > 1) {
                 for (i = 1, len = strlen(buf); i < argc && len < sizeof(buf)-1; i++) {                  for (i = 1, len = strlen(buf); i < argc && len < sizeof(buf)-1; i++) {
   
Line 1514 
Line 1511 
                                 break;                                  break;
   
                         /* Copy next argument, NUL terminate always */                          /* Copy next argument, NUL terminate always */
                         strncpy(&buf[len], argv[i], sizeof(buf) - len - 1);                          strlcpy(&buf[len], argv[i], sizeof(buf) - len);
                         buf[sizeof(buf) - 1] = '\0';  
   
                         /* Update string length */                          /* Update string length */
                         len = strlen(buf);                          len = strlen(buf);
Line 1761 
Line 1757 
         }          }
         ntflag++;          ntflag++;
         code = ntflag;          code = ntflag;
         (void)strncpy(ntin, argv[1], sizeof(ntin) - 1);          (void)strlcpy(ntin, argv[1], sizeof(ntin));
         ntin[sizeof(ntin) - 1] = '\0';  
         if (argc == 2) {          if (argc == 2) {
                 ntout[0] = '\0';                  ntout[0] = '\0';
                 return;                  return;
         }          }
         (void)strncpy(ntout, argv[2], sizeof(ntout) - 1);          (void)strlcpy(ntout, argv[2], sizeof(ntout));
         ntout[sizeof(ntout) - 1] = '\0';  
 }  }
   
 char *  char *
Line 2111 
Line 2105 
         if (interactive)          if (interactive)
                 fputs(                  fputs(
 "Enter macro line by line, terminating it with a null line.\n", ttyout);  "Enter macro line by line, terminating it with a null line.\n", ttyout);
         (void)strncpy(macros[macnum].mac_name, argv[1],          (void)strlcpy(macros[macnum].mac_name, argv[1],
             sizeof(macros[macnum].mac_name) - 1);              sizeof(macros[macnum].mac_name));
         macros[macnum].mac_name[sizeof(macros[macnum].mac_name) - 1] = '\0';  
         if (macnum == 0)          if (macnum == 0)
                 macros[macnum].mac_start = macbuf;                  macros[macnum].mac_start = macbuf;
         else          else

Legend:
Removed from v.1.35  
changed lines
  Added in v.1.36