diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2009-08-08 16:05:01 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2009-08-08 16:05:01 +0000 |
commit | 92cc3a691499e3c5cc056bb9bf1a543fc09d32aa (patch) | |
tree | 5d4bdc6de421ae560d78ff16c5c1f217c71c2a0d /cmd-list-windows.c | |
parent | 06ddd3dcf8ad5685e7120be93681ee666e4689fc (diff) | |
download | rtmux-92cc3a691499e3c5cc056bb9bf1a543fc09d32aa.tar.gz rtmux-92cc3a691499e3c5cc056bb9bf1a543fc09d32aa.tar.bz2 rtmux-92cc3a691499e3c5cc056bb9bf1a543fc09d32aa.zip |
Handle ttyname(3) failure better.
Diffstat (limited to 'cmd-list-windows.c')
-rw-r--r-- | cmd-list-windows.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/cmd-list-windows.c b/cmd-list-windows.c index e5a45be2..c2f8bbd1 100644 --- a/cmd-list-windows.c +++ b/cmd-list-windows.c @@ -72,9 +72,10 @@ cmd_list_windows_exec(struct cmd *self, struct cmd_ctx *ctx) } size += gd->hsize * sizeof *gd->linedata; + name = NULL; if (wp->fd != -1) name = ttyname(wp->fd); - else + if (name == NULL) name = "unknown"; ctx->print(ctx, " %s [%ux%u] [history %u/%u, %llu bytes]", |