Module: monitoring-plugins
 Branch: master
 Commit: 6e64973a4486248ff6c3de7d72637e44b6474c3e
 Author: Sven Nierlein <s...@consol.de>
   Date: Mon Mar 27 12:59:53 2023 +0200
    URL: 
https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=6e64973

simplify code

if statement is always true at this point, so remove it.

---

 plugins/check_snmp.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c
index c4ddd0e..aefda3d 100644
--- a/plugins/check_snmp.c
+++ b/plugins/check_snmp.c
@@ -1179,10 +1179,7 @@ multiply (char *str)
 
        val = strtod (str, &endptr);
        if ((val == 0.0) && (endptr == str)) {
-               if(multiplier != 1) {
-                       die(STATE_UNKNOWN, _("multiplier set (%.1f), but input 
is not a number: %s"), multiplier, str);
-               }
-               return str;
+               die(STATE_UNKNOWN, _("multiplier set (%.1f), but input is not a 
number: %s"), multiplier, str);
        }
 
        if(verbose>2)

Reply via email to