diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2013-08-01 23:39:09 +0100 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2013-08-01 23:39:09 +0100 |
commit | 27364345bf68785af58131c47ef46ff081622537 (patch) | |
tree | 18d7a3da6abc0dc484c19a0d4d36824cdb3bb7c0 /format.c | |
parent | 35c19ffc284da8f37f62b1696f5d5d5e6ca2329c (diff) | |
download | rtmux-27364345bf68785af58131c47ef46ff081622537.tar.gz rtmux-27364345bf68785af58131c47ef46ff081622537.tar.bz2 rtmux-27364345bf68785af58131c47ef46ff081622537.zip |
Don't add client formats when they are NULL.
Diffstat (limited to 'format.c')
-rw-r--r-- | format.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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); |