aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd-list-windows.c3
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]",