diff options
-rw-r--r-- | usr.bin/top/display.c | 11 | ||||
-rw-r--r-- | usr.bin/top/display.h | 6 |
2 files changed, 9 insertions, 8 deletions
diff --git a/usr.bin/top/display.c b/usr.bin/top/display.c index a1adf0f81fb..d6d821ac79a 100644 --- a/usr.bin/top/display.c +++ b/usr.bin/top/display.c @@ -1,4 +1,4 @@ -/* $OpenBSD: display.c,v 1.12 2003/06/12 22:30:23 pvalchev Exp $ */ +/* $OpenBSD: display.c,v 1.13 2003/06/13 04:29:59 pvalchev Exp $ */ /* * Top users/processes display for Unix @@ -53,6 +53,7 @@ #include <term.h> #include <time.h> #include <unistd.h> +#include <stdarg.h> #include "screen.h" /* interface to screen package */ #include "layout.h" /* defines for screen position layout */ @@ -781,14 +782,16 @@ display_header(int t) } } -/*VARARGS2*/ void -new_message(int type, char *msgfmt, caddr_t a1, caddr_t a2, caddr_t a3) +new_message(int type, const char *msgfmt, ...) { int i; + va_list ap; + va_start(ap, msgfmt); /* first, format the message */ - (void) snprintf(next_msg, sizeof(next_msg), msgfmt, a1, a2, a3); + vsnprintf(next_msg, sizeof(next_msg), msgfmt, ap); + va_end(ap); if (msglen > 0) { diff --git a/usr.bin/top/display.h b/usr.bin/top/display.h index 5900f59e314..532e27c6fa3 100644 --- a/usr.bin/top/display.h +++ b/usr.bin/top/display.h @@ -1,4 +1,4 @@ -/* $OpenBSD: display.h,v 1.5 2003/06/12 22:30:23 pvalchev Exp $ */ +/* $OpenBSD: display.h,v 1.6 2003/06/13 04:29:59 pvalchev Exp $ */ /* * Top users/processes display for Unix @@ -30,8 +30,6 @@ /* constants needed for display.c */ -/* "type" argument for new_message function */ - #define MT_standout 1 #define MT_delayed 2 @@ -55,7 +53,7 @@ extern void i_process(int, char *); extern void u_process(int, char *); extern void u_endscreen(int); extern void display_header(int); -extern void new_message(); /* XXX */ +extern void new_message(int, const char *, ...); extern void clear_message(void); extern int readline(char *, int, int); extern char *printable(char *); |