# define FROM_STRING "off"
#endif
-/* Uh... same thing as UT_NAMESIZE */
-#define USERSZ (sizeof u->ut_user)
-
/* Arbitary setting, not too big for the screen, max host size */
#define HOSTSZ 40
unsigned long long jcpu;
int ut_pid_found;
unsigned i;
- char uname[USERSZ + 1] = "", tty[5 + sizeof u->ut_line + 1] = "/dev/";
+ char uname[UT_NAMESIZE + 1] = "", tty[5 + UT_LINESIZE + 1] = "/dev/";
const proc_t *best;
for (i = 0; i < sizeof(u->ut_line); i++)
return;
/* force NUL term for printf */
- strncpy(uname, u->ut_user, USERSZ);
+ strncpy(uname, u->ut_user, UT_NAMESIZE);
if (formtype) {
printf("%-*.*s%-9.8s", userlen + 1, userlen, uname, u->ut_line);
/* Get user field length from environment */
if ((env_var = getenv("PROCPS_USERLEN")) != NULL) {
userlen = atoi(env_var);
- if (userlen < 8 || userlen > USERSZ) {
+ if (userlen < 8 || userlen > UT_NAMESIZE) {
xwarnx
(_("User length environment PROCPS_USERLEN must be between 8 and %zu, ignoring.\n"),
- USERSZ);
+ UT_NAMESIZE);
userlen = 8;
}
}
break;
if (u->ut_type != USER_PROCESS)
continue;
- if (!strncmp(u->ut_user, user, USERSZ))
+ if (!strncmp(u->ut_user, user, UT_NAMESIZE))
showinfo(u, longform, maxcmd, from, userlen,
fromlen);
}