From bd031f809422ea88b9619924911aa5112f95b6b3 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Tue, 27 Oct 2015 11:55:30 +0100 Subject: flowtop: Use bool for show_src option Use boolean false/true for show_src option value. This makes the handling of on/off parameters more consistent. Signed-off-by: Vadim Kochan Signed-off-by: Tobias Klauser --- flowtop.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/flowtop.c b/flowtop.c index 0777a34..50ceccb 100644 --- a/flowtop.c +++ b/flowtop.c @@ -106,11 +106,12 @@ struct sysctl_params_ctx { static volatile bool is_flow_collecting; static volatile sig_atomic_t sigint = 0; -static int what = INCLUDE_IPV4 | INCLUDE_IPV6 | INCLUDE_TCP, show_src = 0; +static int what = INCLUDE_IPV4 | INCLUDE_IPV6 | INCLUDE_TCP; static struct flow_list flow_list; static struct sysctl_params_ctx sysctl = { -1, -1 }; static unsigned int interval = 1; +static bool show_src = false; static bool resolve_dns = true; static bool resolve_geoip = true; @@ -1113,7 +1114,7 @@ static void presenter_screen_update(WINDOW *screen, struct flow_list *fl, presenter_screen_do_line(screen, n, &line); line++; - maxy -= (2 + 1 * show_src); + maxy -= (2 + (show_src ? 1 : 0)); } mvwprintw(screen, 1, 2, @@ -1534,7 +1535,7 @@ int main(int argc, char **argv) what_cmd |= INCLUDE_SCTP; break; case 's': - show_src = 1; + show_src = true; break; case 'u': update_geoip(); -- cgit v1.2.3-54-g00ecf