summaryrefslogtreecommitdiff
path: root/usr.bin/rwho
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-04-13 02:30:35 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-04-13 02:30:35 +0000
commit5c6dd2c4ce4e4648eb9770a02c711071f9c0b8ab (patch)
tree4f66459c629146a7b802489504a8b62da998afe0 /usr.bin/rwho
parent7df5c2149408ef038db6f223799b9c0fdf49f757 (diff)
vis usernames; bitblt is paranoid
Diffstat (limited to 'usr.bin/rwho')
-rw-r--r--usr.bin/rwho/rwho.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.bin/rwho/rwho.c b/usr.bin/rwho/rwho.c
index 90ce15068f9..0135865dfb5 100644
--- a/usr.bin/rwho/rwho.c
+++ b/usr.bin/rwho/rwho.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rwho.c,v 1.7 1997/04/13 02:21:16 deraadt Exp $ */
+/* $OpenBSD: rwho.c,v 1.8 1997/04/13 02:30:34 deraadt Exp $ */
/*
* Copyright (c) 1983 The Regents of the University of California.
@@ -41,7 +41,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)rwho.c 5.5 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$OpenBSD: rwho.c,v 1.7 1997/04/13 02:21:16 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: rwho.c,v 1.8 1997/04/13 02:30:34 deraadt Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -52,6 +52,7 @@ static char rcsid[] = "$OpenBSD: rwho.c,v 1.7 1997/04/13 02:21:16 deraadt Exp $"
#include <string.h>
#include <unistd.h>
#include <stdlib.h>
+#include <vis.h>
DIR *dirp;
@@ -158,11 +159,12 @@ main(argc, argv)
}
mp = myutmp;
for (i = 0; i < nusers; i++) {
- char buf[BUFSIZ];
+ char buf[BUFSIZ], vis_user[4*8];
(void)snprintf(buf, sizeof buf, "%s:%s", mp->myhost,
mp->myutmp.out_line);
+ strvis(vis_user, mp->myutmp.out_name, VIS_CSTYLE);
printf("%-8.8s %-*s %.12s",
- mp->myutmp.out_name,
+ vis_user,
width,
buf,
ctime((time_t *)&mp->myutmp.out_time)+4);