=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/tmux/status.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -r1.9 -r1.10 --- src/usr.bin/tmux/status.c 2009/07/15 07:50:34 1.9 +++ src/usr.bin/tmux/status.c 2009/07/15 17:39:00 1.10 @@ -1,4 +1,4 @@ -/* $OpenBSD: status.c,v 1.9 2009/07/15 07:50:34 nicm Exp $ */ +/* $OpenBSD: status.c,v 1.10 2009/07/15 17:39:00 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -465,17 +465,20 @@ 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);