diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-09-26 11:44:29 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-09-26 11:44:29 +0200 |
commit | ffe4844da89587a3a5cb806abd01d61c1b4b4aa4 (patch) | |
tree | 4edd6b4604b1938c825cd3f653dfa83342122056 /sys/src/cmd/cwfs/con.c | |
parent | 76e0968e35f03ec848093072458e3d15bee2f372 (diff) |
cwfs: various cleanups
- consistently refer to Dentry.name length with NAMELEN
- make sure whoname is null terminated
- remove useless nil check for whoname
Diffstat (limited to 'sys/src/cmd/cwfs/con.c')
-rw-r--r-- | sys/src/cmd/cwfs/con.c | 5 |
1 files changed, 2 insertions, 3 deletions
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: "<nowhoname>", cp->whochan); + print("%3d: %10s %24s", cp->chan, cp->whoname, cp->whochan); if(cp->whoprint) cp->whoprint(cp); print("\n"); |