diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2009-07-15 17:39:00 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2009-07-15 17:39:00 +0000 |
commit | 92da443a9e02a2238d4415e0dcf3796d3929b290 (patch) | |
tree | dba39ebf34f33d4d399e9dc73591e2a6668c8f07 /status.c | |
parent | 780fd8f7a6fde6f14016f3c4f94f04d8118859c1 (diff) | |
download | rtmux-92da443a9e02a2238d4415e0dcf3796d3929b290.tar.gz rtmux-92da443a9e02a2238d4415e0dcf3796d3929b290.tar.bz2 rtmux-92da443a9e02a2238d4415e0dcf3796d3929b290.zip |
Make status_message_set a variadic printf-like function. No functional change -
helpful for a couple of things coming soon.
Diffstat (limited to 'status.c')
-rw-r--r-- | status.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -465,17 +465,20 @@ status_print(struct session *s, struct winlink *wl, struct grid_cell *gc) return (text); } -void -status_message_set(struct client *c, const char *msg) +void printflike2 +status_message_set(struct client *c, const char *fmt, ...) { struct timeval tv; + va_list ap; int delay; delay = options_get_number(&c->session->options, "display-time"); tv.tv_sec = delay / 1000; tv.tv_usec = (delay % 1000) * 1000L; - c->message_string = xstrdup(msg); + va_start(ap, fmt); + xvasprintf(&c->message_string, fmt, ap); + va_end(ap); if (gettimeofday(&c->message_timer, NULL) != 0) fatal("gettimeofday"); timeradd(&c->message_timer, &tv, &c->message_timer); |