summaryrefslogtreecommitdiffstats
path: root/usr.bin/w/w.c
diff options
context:
space:
mode:
authorume <ume@FreeBSD.org>2009-08-30 11:17:42 +0000
committerume <ume@FreeBSD.org>2009-08-30 11:17:42 +0000
commit5fb95a2095446b02c21f0e4ecad4b7bff41c856a (patch)
tree7bf9aeb96248569d4de361589958b5bc4732cbe8 /usr.bin/w/w.c
parent7417f9bcd242fe20479c87d0e5f24840616ab1d3 (diff)
downloadFreeBSD-src-5fb95a2095446b02c21f0e4ecad4b7bff41c856a.zip
FreeBSD-src-5fb95a2095446b02c21f0e4ecad4b7bff41c856a.tar.gz
Fix the problem that the entry broke into two lines with multi-byte
AM/PM format. Reported by: takawata
Diffstat (limited to 'usr.bin/w/w.c')
-rw-r--r--usr.bin/w/w.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/w/w.c b/usr.bin/w/w.c
index 379e6a4..10ec7b0 100644
--- a/usr.bin/w/w.c
+++ b/usr.bin/w/w.c
@@ -137,7 +137,7 @@ main(int argc, char *argv[])
struct stat *stp;
FILE *ut;
time_t touched;
- int ch, i, nentries, nusers, wcmd, longidle, dropgid;
+ int ch, i, nentries, nusers, wcmd, longidle, longattime, dropgid;
const char *memf, *nlistf, *p;
char *x_suffix;
char buf[MAXHOSTNAMELEN], errbuf[_POSIX2_LINE_MAX];
@@ -406,9 +406,10 @@ main(int argc, char *argv[])
ep->utmp.ut_line : ep->utmp.ut_line + 3,
W_DISPHOSTSIZE, W_DISPHOSTSIZE, *p ? p : "-");
t = _time_to_time32(ep->utmp.ut_time);
- pr_attime(&t, &now);
+ longattime = pr_attime(&t, &now);
longidle = pr_idle(ep->idle);
- (void)printf("%.*s\n", argwidth - longidle, ep->args);
+ (void)printf("%.*s\n", argwidth - longidle - longattime,
+ ep->args);
}
(void)kvm_close(kd);
exit(0);
OpenPOWER on IntegriCloud