From 23a993a7b5abf5fef84b39473385089038f025c8 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Sat, 8 Aug 2009 16:05:02 +0000 Subject: Handle ttyname(3) failure better. --- usr.bin/tmux/cmd-list-windows.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'usr.bin') diff --git a/usr.bin/tmux/cmd-list-windows.c b/usr.bin/tmux/cmd-list-windows.c index 4a0c38b6cdb..7c050ca32ca 100644 --- a/usr.bin/tmux/cmd-list-windows.c +++ b/usr.bin/tmux/cmd-list-windows.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-list-windows.c,v 1.5 2009/08/08 13:29:27 nicm Exp $ */ +/* $OpenBSD: cmd-list-windows.c,v 1.6 2009/08/08 16:05:01 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -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]", -- cgit v1.2.3