From d8508a468e716a887fc49618cdc5f69c0d315de5 Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Sun, 26 Oct 2014 20:37:16 +0000 Subject: Add explicit braces to suppress compiler warnings. iostat.c:214:3: warning: add explicit braces to avoid dangling else [-Wdangling-else] ok guenther@ millert@ --- usr.sbin/iostat/iostat.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'usr.sbin') diff --git a/usr.sbin/iostat/iostat.c b/usr.sbin/iostat/iostat.c index 3b4d14c9928..fefb7edf4b0 100644 --- a/usr.sbin/iostat/iostat.c +++ b/usr.sbin/iostat/iostat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: iostat.c,v 1.35 2014/09/15 19:08:22 miod Exp $ */ +/* $OpenBSD: iostat.c,v 1.36 2014/10/26 20:37:15 brad Exp $ */ /* $NetBSD: iostat.c,v 1.10 1996/10/25 18:21:58 scottr Exp $ */ /* @@ -208,19 +208,21 @@ header(void) return; /* Main Headers. */ - if (ISSET(todo, SHOW_TTY)) + if (ISSET(todo, SHOW_TTY)) { if (ISSET(todo, SHOW_TOTALS)) printf(" tty"); else printf(" tty"); + } if (ISSET(todo, SHOW_STATS_1)) for (i = 0; i < dk_ndrive; i++) - if (cur.dk_select[i]) + if (cur.dk_select[i]) { if (ISSET(todo, SHOW_TOTALS)) printf(" %18.18s ", cur.dk_name[i]); else printf(" %16.16s ", cur.dk_name[i]); + } if (ISSET(todo, SHOW_STATS_2)) for (i = 0; i < dk_ndrive; i++) if (cur.dk_select[i]) @@ -231,11 +233,12 @@ header(void) printf("\n"); /* Sub-Headers. */ - if (ISSET(todo, SHOW_TTY)) + if (ISSET(todo, SHOW_TTY)) { if (ISSET(todo, SHOW_TOTALS)) printf(" tin tout"); else printf(" tin tout"); + } if (ISSET(todo, SHOW_STATS_1)) for (i = 0; i < dk_ndrive; i++) @@ -365,13 +368,14 @@ display(void) if (ISSET(todo, SHOW_TOTALS)) etime = 1.0; - if (ISSET(todo, SHOW_TTY)) + if (ISSET(todo, SHOW_TTY)) { if (ISSET(todo, SHOW_TOTALS)) printf("%6.0f %8.0f", cur.tk_nin / etime, cur.tk_nout / etime); else printf("%4.0f %4.0f", cur.tk_nin / etime, cur.tk_nout / etime); + } if (ISSET(todo, SHOW_STATS_1)) disk_stats(etime); -- cgit v1.2.3