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

Diff for /src/usr.bin/ssh/ssh-keygen.c between version 1.162 and 1.163

version 1.162, 2007/09/11 15:47:17 version 1.163, 2007/10/02 17:49:58
Line 528 
Line 528 
         f = fopen(identity_file, "r");          f = fopen(identity_file, "r");
         if (f != NULL) {          if (f != NULL) {
                 while (fgets(line, sizeof(line), f)) {                  while (fgets(line, sizeof(line), f)) {
                         i = strlen(line) - 1;                          if ((cp = strchr(line, '\n')) == NULL) {
                         if (line[i] != '\n') {  
                                 error("line %d too long: %.40s...", num, line);                                  error("line %d too long: %.40s...", num, line);
                                 skip = 1;                                  skip = 1;
                                 continue;                                  continue;
Line 539 
Line 538 
                                 skip = 0;                                  skip = 0;
                                 continue;                                  continue;
                         }                          }
                         line[i] = '\0';                          *cp = '\0';
   
                         /* Skip leading whitespace, empty and comment lines. */                          /* Skip leading whitespace, empty and comment lines. */
                         for (cp = line; *cp == ' ' || *cp == '\t'; cp++)                          for (cp = line; *cp == ' ' || *cp == '\t'; cp++)
Line 607 
Line 606 
         Key *public;          Key *public;
         char *cp, *cp2, *kp, *kp2;          char *cp, *cp2, *kp, *kp2;
         char line[16*1024], tmp[MAXPATHLEN], old[MAXPATHLEN];          char line[16*1024], tmp[MAXPATHLEN], old[MAXPATHLEN];
         int c, i, skip = 0, inplace = 0, num = 0, invalid = 0, has_unhashed = 0;          int c, skip = 0, inplace = 0, num = 1, invalid = 0, has_unhashed = 0;
   
         if (!have_identity) {          if (!have_identity) {
                 cp = tilde_expand_filename(_PATH_SSH_USER_HOSTFILE, pw->pw_uid);                  cp = tilde_expand_filename(_PATH_SSH_USER_HOSTFILE, pw->pw_uid);
Line 642 
Line 641 
         }          }
   
         while (fgets(line, sizeof(line), in)) {          while (fgets(line, sizeof(line), in)) {
                 num++;                  if ((cp = strchr(line, '\n')) == NULL) {
                 i = strlen(line) - 1;  
                 if (line[i] != '\n') {  
                         error("line %d too long: %.40s...", num, line);                          error("line %d too long: %.40s...", num, line);
                         skip = 1;                          skip = 1;
                         invalid = 1;                          invalid = 1;
                         continue;                          continue;
                 }                  }
                   num++;
                 if (skip) {                  if (skip) {
                         skip = 0;                          skip = 0;
                         continue;                          continue;
                 }                  }
                 line[i] = '\0';                  *cp = '\0';
   
                 /* Skip leading whitespace, empty and comment lines. */                  /* Skip leading whitespace, empty and comment lines. */
                 for (cp = line; *cp == ' ' || *cp == '\t'; cp++)                  for (cp = line; *cp == ' ' || *cp == '\t'; cp++)

Legend:
Removed from v.1.162  
changed lines
  Added in v.1.163