[BACK]Return to ssh-keyscan.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

Diff for /src/usr.bin/ssh/ssh-keyscan.c between version 1.119 and 1.120

version 1.119, 2018/03/02 21:40:15 version 1.120, 2018/06/06 18:29:18
Line 626 
Line 626 
 {  {
         int debug_flag = 0, log_level = SYSLOG_LEVEL_INFO;          int debug_flag = 0, log_level = SYSLOG_LEVEL_INFO;
         int opt, fopt_count = 0, j;          int opt, fopt_count = 0, j;
         char *tname, *cp, line[NI_MAXHOST];          char *tname, *cp, *line = NULL;
           size_t linesize = 0;
         FILE *fp;          FILE *fp;
         u_long linenum;  
   
         extern int optind;          extern int optind;
         extern char *optarg;          extern char *optarg;
Line 747 
Line 747 
                 else if ((fp = fopen(argv[j], "r")) == NULL)                  else if ((fp = fopen(argv[j], "r")) == NULL)
                         fatal("%s: %s: %s", __progname, argv[j],                          fatal("%s: %s: %s", __progname, argv[j],
                             strerror(errno));                              strerror(errno));
                 linenum = 0;  
   
                 while (read_keyfile_line(fp,                  while (getline(&line, &linesize, fp) != -1) {
                     argv[j] == NULL ? "(stdin)" : argv[j], line, sizeof(line),  
                     &linenum) != -1) {  
                         /* Chomp off trailing whitespace and comments */                          /* Chomp off trailing whitespace and comments */
                         if ((cp = strchr(line, '#')) == NULL)                          if ((cp = strchr(line, '#')) == NULL)
                                 cp = line + strlen(line) - 1;                                  cp = line + strlen(line) - 1;
Line 776 
Line 773 
   
                 fclose(fp);                  fclose(fp);
         }          }
           free(line);
   
         while (optind < argc)          while (optind < argc)
                 do_host(argv[optind++]);                  do_host(argv[optind++]);

Legend:
Removed from v.1.119  
changed lines
  Added in v.1.120