diff --git a/usr.bin/top/commands.c b/usr.bin/top/commands.c index 5b739e6acbbf..de871da8909b 100644 --- a/usr.bin/top/commands.c +++ b/usr.bin/top/commands.c @@ -129,11 +129,7 @@ next_field(char *str) } static int -scanint(str, intp) - -char *str; -int *intp; - +scanint(char *str, int *intp) { int val = 0; char ch; diff --git a/usr.bin/top/display.c b/usr.bin/top/display.c index f37384923090..b8f84711c174 100644 --- a/usr.bin/top/display.c +++ b/usr.bin/top/display.c @@ -1011,7 +1011,7 @@ new_message(int type, char *msgfmt, ...) va_start(args, msgfmt); /* first, format the message */ - snprintf(next_msg, sizeof(next_msg), msgfmt, args); + vsnprintf(next_msg, sizeof(next_msg), msgfmt, args); va_end(args); diff --git a/usr.bin/top/machine.c b/usr.bin/top/machine.c index 51158d2c6526..8f15a0a9cc9f 100644 --- a/usr.bin/top/machine.c +++ b/usr.bin/top/machine.c @@ -762,7 +762,6 @@ get_process_info(struct system_info *si, struct process_select *sel, int show_self; int show_system; int show_uid; - int show_command; int show_kidle; /* @@ -832,7 +831,6 @@ get_process_info(struct system_info *si, struct process_select *sel, show_self = sel->self == -1; show_system = sel->system; show_uid = sel->uid[0] != -1; - show_command = sel->command != NULL; show_kidle = sel->kidle; /* count up process states and get pointers to interesting procs */ @@ -984,8 +982,7 @@ format_next_process(caddr_t xhandle, char *(*get_userid)(int), int flags) break; default: - if (state >= 0 && - state < sizeof(state_abbrev) / sizeof(*state_abbrev)) + if (state < sizeof(state_abbrev) / sizeof(*state_abbrev)) sprintf(status, "%.6s", state_abbrev[state]); else sprintf(status, "?%5zu", state); diff --git a/usr.bin/top/top.c b/usr.bin/top/top.c index 8392e92be6f2..fb1928b0db8c 100644 --- a/usr.bin/top/top.c +++ b/usr.bin/top/top.c @@ -94,7 +94,7 @@ static void (*d_process)(int line, char *thisline) = i_process; static void reset_display(void); static void -reset_uids() +reset_uids(void) { for (size_t i = 0; i < TOP_MAX_UIDS; ++i) ps.uid[i] = -1; @@ -198,11 +198,7 @@ end: } int -main(argc, argv) - -int argc; -char *argv[]; - +main(int argc, char *argv[]) { int i; int active_procs;