From ffe4844da89587a3a5cb806abd01d61c1b4b4aa4 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sat, 26 Sep 2015 11:44:29 +0200 Subject: cwfs: various cleanups - consistently refer to Dentry.name length with NAMELEN - make sure whoname is null terminated - remove useless nil check for whoname --- sys/src/cmd/cwfs/con.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'sys/src/cmd/cwfs/con.c') diff --git a/sys/src/cmd/cwfs/con.c b/sys/src/cmd/cwfs/con.c index ea1154b58..9e1e7bc05 100644 --- a/sys/src/cmd/cwfs/con.c +++ b/sys/src/cmd/cwfs/con.c @@ -14,7 +14,7 @@ consserve(void) { int i; - strncpy(cons.chan->whochan, "console", sizeof(cons.chan->whochan)); + snprint(cons.chan->whochan, sizeof(cons.chan->whochan), "console"); installcmds(); con_session(); cmd_exec("cfs"); @@ -312,8 +312,7 @@ cmd_who(int argc, char *argv[]) continue; } } - print("%3d: %10s %24s", cp->chan, - cp->whoname? cp->whoname: "", cp->whochan); + print("%3d: %10s %24s", cp->chan, cp->whoname, cp->whochan); if(cp->whoprint) cp->whoprint(cp); print("\n"); -- cgit v1.2.3