tcp: fix coverity warning
Type: fix
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I60828bc084b9adbb925c306d26060412c410c516
diff --git a/src/vnet/tcp/tcp_cli.c b/src/vnet/tcp/tcp_cli.c
index ada2ac0..b76b404 100644
--- a/src/vnet/tcp/tcp_cli.c
+++ b/src/vnet/tcp/tcp_cli.c
@@ -907,7 +907,7 @@
int max_index, i;
n_elts = pool_elts (tm->half_open_connections);
- max_index = pool_len (tm->half_open_connections) - 1;
+ max_index = clib_max (pool_len (tm->half_open_connections), 1) - 1;
if (verbose && end == ~0 && n_elts > 50)
{
vlib_cli_output (vm, "Too many connections, use range <start> <end>");
@@ -966,7 +966,7 @@
{
if (unformat (line_input, "range %u %u", &start, &end))
;
- else if (unformat (line_input, "verbose %d"), &verbose)
+ else if (unformat (line_input, "verbose %d", &verbose))
;
else if (unformat (line_input, "verbose"))
verbose = 1;