summaryrefslogtreecommitdiff
path: root/usr.bin/tmux
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2013-03-25 11:41:32 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2013-03-25 11:41:32 +0000
commitfa5f89f2e208754ae47e3d06739d6e5cb0e8df54 (patch)
treec9290832ee3937e1f70fa48a994f9935371762a0 /usr.bin/tmux
parentad1f17e8ec4b273ef9e3742a2c4f11cf3dd79ba5 (diff)
Don't let display-message crash if no client, from George Nachman.
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r--usr.bin/tmux/cmd-display-message.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/tmux/cmd-display-message.c b/usr.bin/tmux/cmd-display-message.c
index f326a5c98cb..173c794df38 100644
--- a/usr.bin/tmux/cmd-display-message.c
+++ b/usr.bin/tmux/cmd-display-message.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-display-message.c,v 1.20 2013/03/24 09:54:10 nicm Exp $ */
+/* $OpenBSD: cmd-display-message.c,v 1.21 2013/03/25 11:41:31 nicm Exp $ */
/*
* Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org>
@@ -90,7 +90,10 @@ cmd_display_message_exec(struct cmd *self, struct cmd_q *cmdq)
msg = format_expand(ft, out);
if (args_has(self->args, 'p'))
cmdq_print(cmdq, "%s", msg);
- else
+ else if (c == NULL) {
+ cmdq_error(cmdq, "no client available");
+ return (CMD_RETURN_ERROR);
+ } else
status_message_set(c, "%s", msg);
free(msg);
format_free(ft);