diff options
author | ats <ats@FreeBSD.org> | 1994-12-26 17:29:03 +0000 |
---|---|---|
committer | ats <ats@FreeBSD.org> | 1994-12-26 17:29:03 +0000 |
commit | bface82b878e06cc6170a5f09c49be68ca7c671d (patch) | |
tree | 094e30971d44fcc6b609ea9db8c5d50d3207e635 /usr.bin | |
parent | d82158a7e001222b1a02dc1bb22a776d25040970 (diff) | |
download | FreeBSD-src-bface82b878e06cc6170a5f09c49be68ca7c671d.zip FreeBSD-src-bface82b878e06cc6170a5f09c49be68ca7c671d.tar.gz |
The out_line doesn't need to be zero terminated, so print it not with %s
but with a %-8.8s instead. this prevents funny output, if the out_line
contains a long hostname that is larger than 8 chars.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/rwho/rwho.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/rwho/rwho.c b/usr.bin/rwho/rwho.c index ee9c76d..6191803 100644 --- a/usr.bin/rwho/rwho.c +++ b/usr.bin/rwho/rwho.c @@ -144,7 +144,7 @@ main(argc, argv) mp = myutmp; for (i = 0; i < nusers; i++) { char buf[BUFSIZ]; - (void)sprintf(buf, "%s:%s", mp->myhost, mp->myutmp.out_line); + (void)sprintf(buf, "%s:%-8.8s", mp->myhost, mp->myutmp.out_line); printf("%-8.8s %-*s %.12s", mp->myutmp.out_name, width, |