Let the width of the username column depend on the rwho file format.
Right now the code uses UT_NAMESIZE, but this makes little sense, because rwho(1) parses files generated by rwhod(8). Not utmp(5) files.
This commit is contained in:
parent
bfa3a5e5bc
commit
b1625b09d9
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=200997
@ -61,7 +61,6 @@ __FBSDID("$FreeBSD$");
|
|||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <timeconv.h>
|
#include <timeconv.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <utmp.h>
|
|
||||||
|
|
||||||
DIR *dirp;
|
DIR *dirp;
|
||||||
|
|
||||||
@ -172,7 +171,7 @@ main(int argc, char *argv[])
|
|||||||
(void)sprintf(buf, "%s:%-.*s", mp->myhost,
|
(void)sprintf(buf, "%s:%-.*s", mp->myhost,
|
||||||
sizeof(mp->myutmp.out_line), mp->myutmp.out_line);
|
sizeof(mp->myutmp.out_line), mp->myutmp.out_line);
|
||||||
printf("%-*.*s %-*s %s",
|
printf("%-*.*s %-*s %s",
|
||||||
UT_NAMESIZE, sizeof(mp->myutmp.out_name),
|
sizeof(mp->myutmp.out_name), sizeof(mp->myutmp.out_name),
|
||||||
mp->myutmp.out_name,
|
mp->myutmp.out_name,
|
||||||
width,
|
width,
|
||||||
buf,
|
buf,
|
||||||
|
Loading…
Reference in New Issue
Block a user