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

Diff for /src/usr.bin/chpass/Attic/pw_yp.c between version 1.2 and 1.3

version 1.2, 1996/06/26 05:31:58 version 1.3, 1996/08/30 13:09:41
Line 207 
Line 207 
         return (pwent);          return (pwent);
 }  }
   
   static char *__yplin;
   
 struct passwd *  struct passwd *
 ypgetpwnam(nam)  ypgetpwnam(nam)
         char *nam;          char *nam;
 {  {
         static struct passwd pwent;          static struct passwd pwent;
         static char line[1024];  
         char *val;          char *val;
         int reason, vallen;          int reason, vallen;
   
Line 235 
Line 236 
                 break;                  break;
         }          }
         val[vallen] = '\0';          val[vallen] = '\0';
         strcpy(line, val);          if (__yplin)
                   free(__yplin);
           __yplin = (char *)malloc(vallen + 1);
           strcpy(__yplin, val);
         free(val);          free(val);
   
         return(interpret(&pwent, line));          return(interpret(&pwent, __yplin));
 }  }
   
 struct passwd *  struct passwd *
Line 246 
Line 250 
         uid_t uid;          uid_t uid;
 {  {
         static struct passwd pwent;          static struct passwd pwent;
         static char line[1024];  
         char *val;          char *val;
         int reason, vallen;          int reason, vallen;
         char namebuf[16];          char namebuf[16];
Line 268 
Line 271 
                 break;                  break;
         }          }
         val[vallen] = '\0';          val[vallen] = '\0';
         strcpy(line, val);          if (__yplin)
                   free(__yplin);
           __yplin = (char *)malloc(vallen + 1);
           strcpy(__yplin, val);
         free(val);          free(val);
   
         return(interpret(&pwent, line));          return(interpret(&pwent, __yplin));
 }  }
   
 #endif  /* YP */  #endif  /* YP */

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3