diff options
author | 2013-10-10 11:47:11 +0000 | |
---|---|---|
committer | 2013-10-10 11:47:11 +0000 | |
commit | 1cb8fc9ac0e5fb518e391365a9079a5bf05b75b0 (patch) | |
tree | 7540c8d8cd486875c5c89ec1bfbdadd890ba3fa2 | |
parent | Missing space in refresh-client synopsis. (diff) | |
download | wireguard-openbsd-1cb8fc9ac0e5fb518e391365a9079a5bf05b75b0.tar.xz wireguard-openbsd-1cb8fc9ac0e5fb518e391365a9079a5bf05b75b0.zip |
Don't add client formats when they are NULL.
-rw-r--r-- | usr.bin/tmux/format.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/tmux/format.c b/usr.bin/tmux/format.c index 4a7d5efb4d9..3c45fa1515e 100644 --- a/usr.bin/tmux/format.c +++ b/usr.bin/tmux/format.c @@ -1,4 +1,4 @@ -/* $OpenBSD: format.c,v 1.26 2013/07/05 15:27:14 nicm Exp $ */ +/* $OpenBSD: format.c,v 1.27 2013/10/10 11:47:11 nicm Exp $ */ /* * Copyright (c) 2011 Nicholas Marriott <nicm@users.sourceforge.net> @@ -346,8 +346,10 @@ format_client(struct format_tree *ft, struct client *c) format_add(ft, "client_cwd", "%s", c->cwd); format_add(ft, "client_height", "%u", c->tty.sy); format_add(ft, "client_width", "%u", c->tty.sx); - format_add(ft, "client_tty", "%s", c->tty.path); - format_add(ft, "client_termname", "%s", c->tty.termname); + if (c->tty.path != NULL) + format_add(ft, "client_tty", "%s", c->tty.path); + if (c->tty.termname != NULL) + format_add(ft, "client_termname", "%s", c->tty.termname); t = c->creation_time.tv_sec; format_add(ft, "client_created", "%lld", (long long) t); |