- if (init == 0)
- setpwent(), init = 1;
- while (pw = getpwent()) {
- if (pw->pw_uid < 0 || pw->pw_uid >= NUID)
- continue;
- if (names[pw->pw_uid][0])
- continue;
- strncpy(names[pw->pw_uid], pw->pw_name, NMAX);
- if (pw->pw_uid == uid) {
- return (&names[uid][0]);
- }
- }
- init = 2;
- endpwent();
- return (0);