From 1fdc969f7b06d741be4f9d21332621ffbc40749f Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Wed, 11 Mar 2020 13:56:26 +0100 Subject: [PATCH] ospfd: fix range check for metric Found with -Wlogical-op Signed-off-by: Ruben Kerkhof --- ospfd/ospf_vty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ospfd/ospf_vty.c b/ospfd/ospf_vty.c index fd2ab07261..75f556e39f 100644 --- a/ospfd/ospf_vty.c +++ b/ospfd/ospf_vty.c @@ -93,7 +93,7 @@ static int str2metric(const char *str, int *metric) return 0; *metric = strtol(str, NULL, 10); - if (*metric < 0 && *metric > 16777214) { + if (*metric < 0 || *metric > 16777214) { /* vty_out (vty, "OSPF metric value is invalid\n"); */ return 0; } -- 2.39.5