diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2001-01-31 19:48:07 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2001-01-31 19:48:07 +0000 |
commit | f01de919b130844dcaa167ae3e3e39c854b1fff7 (patch) | |
tree | 3f6c3da283ab92635ef5fce8e4f4b1e508ec2cc2 /usr.bin/rusers | |
parent | 430d9f13e29ddbe9bf4578c4182d65e72815317e (diff) |
fat utmp handling; truncate to 16 chars for now, until we decide how ugly
we will accept.
Diffstat (limited to 'usr.bin/rusers')
-rw-r--r-- | usr.bin/rusers/rusers.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.bin/rusers/rusers.c b/usr.bin/rusers/rusers.c index defc9c49f8c..d4e25ca24c4 100644 --- a/usr.bin/rusers/rusers.c +++ b/usr.bin/rusers/rusers.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rusers.c,v 1.8 1997/08/18 03:11:28 millert Exp $ */ +/* $OpenBSD: rusers.c,v 1.9 2001/01/31 19:48:06 deraadt Exp $ */ /*- * Copyright (c) 1993 John Brezak @@ -29,7 +29,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: rusers.c,v 1.8 1997/08/18 03:11:28 millert Exp $"; +static char rcsid[] = "$OpenBSD: rusers.c,v 1.9 2001/01/31 19:48:06 deraadt Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -165,12 +165,14 @@ rusers_reply(char *replyp, struct sockaddr_in *raddrp) sizeof (local) - strlen (local) - 1); local[sizeof (local) - 1] = 0; - printf("%-8.8s %-*.*s %-12.12s %8s %.18s\n", +#define MAXNAME 16 + printf("%-*.*s %-*.*s %-12.12s %8s %.18s\n", + MAXNAME, UT_NAMESIZE, up->uia_arr[x]->ui_utmp.ut_name, HOST_WIDTH+LINE_WIDTH+1, HOST_WIDTH+LINE_WIDTH+1, local, date, idle_time, remote); } else - printf("%.8s ", + printf("%.*s ", UT_NAMESIZE, up->uia_arr[x]->ui_utmp.ut_name); } if (!longopt) |