From 4305ac7f1d49ed998a4f227e8cecd867c547da48 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 16 Dec 2016 12:56:31 +0100 Subject: [PATCH] BUG/MINOR: cli: "show cli sockets" would always report process 64 Another small bug in "show cli sockets" made the last fix always report process 64 due to a signedness issue in the shift operation when building the mask. --- src/cli.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/cli.c b/src/cli.c index 6fd7455c9..a875d3844 100644 --- a/src/cli.c +++ b/src/cli.c @@ -798,9 +798,8 @@ static int cli_io_handler_show_cli_sock(struct appctx *appctx) if (bind_conf->bind_proc != 0) { int pos; - for (pos = 0; pos < 8 * sizeof(bind_conf->bind_proc); pos++) { - if (bind_conf->bind_proc & (1 << pos)) { + if (bind_conf->bind_proc & (1UL << pos)) { chunk_appendf(&trash, "%d,", pos+1); } }