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

Diff for /src/usr.bin/users/users.c between version 1.7 and 1.8

version 1.7, 2003/06/03 02:56:21 version 1.8, 2003/10/16 16:57:37
Line 82 
Line 82 
         while (fread((char *)&utmp, sizeof(utmp), 1, stdin) == 1) {          while (fread((char *)&utmp, sizeof(utmp), 1, stdin) == 1) {
                 if (*utmp.ut_name) {                  if (*utmp.ut_name) {
                         if (ncnt >= nmax) {                          if (ncnt >= nmax) {
                                 nmax += 32;                                  size_t newmax = nmax + 32;
                                 names = realloc(names,                                  namebuf *newnames;
                                         sizeof (*names) * nmax);  
   
                                 if (!names) {                                  newnames = realloc(names,
                                       sizeof(*names) * newmax);
   
                                   if (newnames == NULL) {
                                         err(1, NULL);                                          err(1, NULL);
                                         /* NOTREACHED */                                          /* NOTREACHED */
                                 }                                  }
                                   names = newnames;
                                   nmax = newmax;
                         }                          }
   
                         (void)strncpy(names[ncnt], utmp.ut_name, UT_NAMESIZE);                          (void)strncpy(names[ncnt], utmp.ut_name, UT_NAMESIZE);

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8