summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/tmux/cmd-display-message.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/usr.bin/tmux/cmd-display-message.c b/usr.bin/tmux/cmd-display-message.c
index 96dc5d6c7ae..2aef0ee0b0a 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.28 2015/04/27 16:25:57 nicm Exp $ */
+/* $OpenBSD: cmd-display-message.c,v 1.29 2015/11/18 16:49:13 nicm Exp $ */
/*
* Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org>
@@ -54,9 +54,6 @@ cmd_display_message_exec(struct cmd *self, struct cmd_q *cmdq)
const char *template;
char *msg;
struct format_tree *ft;
- char out[BUFSIZ];
- time_t t;
- size_t len;
if (args_has(args, 't')) {
wl = cmd_find_pane(cmdq, args_get(args, 't'), &s, &wp);
@@ -94,11 +91,7 @@ cmd_display_message_exec(struct cmd *self, struct cmd_q *cmdq)
ft = format_create();
format_defaults(ft, c, s, wl, wp);
- t = time(NULL);
- len = strftime(out, sizeof out, template, localtime(&t));
- out[len] = '\0';
-
- msg = format_expand(ft, out);
+ msg = format_expand_time(ft, template, time(NULL));
if (args_has(self->args, 'p'))
cmdq_print(cmdq, "%s", msg);
else