-char *names[128];
-char **namp = names;
-putline()
-{
- char temp[NMAX+1];
- strncpy(temp, utmp.ut_name, NMAX);
- temp[NMAX] = 0;
- *namp = malloc(strlen(temp) + 1);
- strcpy(*namp++, temp);
+ if (ncnt) {
+ qsort(names, ncnt, UT_NAMESIZE, scmp);
+ (void)printf("%.*s", UT_NAMESIZE, names[0]);
+ for (cnt = 1; cnt < ncnt; ++cnt)
+ if (strncmp(names[cnt], names[cnt - 1], UT_NAMESIZE))
+ (void)printf(" %.*s", UT_NAMESIZE, names[cnt]);
+ (void)printf("\n");
+ }
+ exit(0);