diff options
Diffstat (limited to 'shell_cmds/who')
-rw-r--r-- | shell_cmds/who/Makefile | 6 | ||||
-rw-r--r-- | shell_cmds/who/utmpentry.c | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/shell_cmds/who/Makefile b/shell_cmds/who/Makefile new file mode 100644 index 0000000..74826ba --- /dev/null +++ b/shell_cmds/who/Makefile @@ -0,0 +1,6 @@ +PROG= who +SRCS= who.c utmpentry.c + +CFLAGS+=-DSUPPORT_UTMPX + +.include <bsd.prog.mk> diff --git a/shell_cmds/who/utmpentry.c b/shell_cmds/who/utmpentry.c index b0e0914..7938d37 100644 --- a/shell_cmds/who/utmpentry.c +++ b/shell_cmds/who/utmpentry.c @@ -319,7 +319,7 @@ getentry(struct utmpentry *e, struct utmp *up) static void getentryx(struct utmpentry *e, struct utmpx *up) { - COMPILE_ASSERT(sizeof(e->name) > sizeof(up->ut_name)); + COMPILE_ASSERT(sizeof(e->name) > sizeof(up->ut_user)); COMPILE_ASSERT(sizeof(e->line) > sizeof(up->ut_line)); COMPILE_ASSERT(sizeof(e->host) > sizeof(up->ut_host)); @@ -331,7 +331,7 @@ getentryx(struct utmpentry *e, struct utmpx *up) * reason we use the size of the _source_ as the length * argument. */ - (void)strncpy(e->name, up->ut_name, sizeof(up->ut_name)); + (void)strncpy(e->name, up->ut_user, sizeof(up->ut_user)); (void)strncpy(e->line, up->ut_line, sizeof(up->ut_line)); (void)strncpy(e->host, up->ut_host, sizeof(up->ut_host)); |