version 1.7, 2003/06/03 02:56:21 |
version 1.8, 2003/10/16 16:57:37 |
|
|
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); |