(PIDSTR_DECL_AND_INIT): Don't assume pid_t fits in int.
authorJim Meyering <jim@meyering.net>
Sun, 13 Jun 2004 22:03:07 +0000 (22:03 +0000)
committerJim Meyering <jim@meyering.net>
Sun, 13 Jun 2004 22:03:07 +0000 (22:03 +0000)
commit5bca9fb5f38fd72c73e519241755fbc9108ee5c8
treeddb62c242d072c4641bdc0035381e590f7b2058f
parentae2fbd3ee7187034fbfcfcfc71859fdb1a21f833
(PIDSTR_DECL_AND_INIT): Don't assume pid_t fits in int.
(UT_ID) [!HAVE_STRUCT_XTMP_UT_ID]: Remove bogus comment,
as (sizeof "??") reliably returns 3.
(print_line): Guard against idle and pid being too long
(which is possible when printing headers).
(print_user): Allocate enough bytes for idlestr.  Use IDLESTR_LEN.
Avoid unnecessary cast of sizeof to int.
(make_id_equals_comment): Do not assume that UT_ID returns
a string; it might return a non-null-terminated array.
Use strncat instead.  It's not very often where strncat is
exactly what you want, but this is one of those rare cases.
src/who.c