diff options
author | Peter Valchev <pvalchev@cvs.openbsd.org> | 2003-06-13 04:30:00 +0000 |
---|---|---|
committer | Peter Valchev <pvalchev@cvs.openbsd.org> | 2003-06-13 04:30:00 +0000 |
commit | 4070211ffd94f929b7558872d538bd9d7e649abb (patch) | |
tree | 800052056afa34a9d12f748277a4d13b5c07e257 /usr.bin/top/display.c | |
parent | 6c80fb38adbc83ca5e6ef9e372974b1f488bfc44 (diff) |
use proper varargs(3), as opposed to a hack; ok millert
Diffstat (limited to 'usr.bin/top/display.c')
-rw-r--r-- | usr.bin/top/display.c | 11 |
1 files changed, 7 insertions, 4 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) { |