Просмотр исходного кода

check_snmp.c: Fixed potential divide by zero

As per: https://github.com/nagios-plugins/nagios-plugins/pull/51

Thanks to Justin McOmie (github user j41785)
abrist 10 лет назад
Родитель
Сommit
cf98f99d76
2 измененных файлов с 2 добавлено и 1 удалено
  1. 1 0
      THANKS.in
  2. 1 1
      plugins/check_snmp.c

+ 1 - 0
THANKS.in

@@ -344,3 +344,4 @@ Damian Myerscough
 nafets
 arvanus
 Roberto Greiner
+Justin McOmie

+ 1 - 1
plugins/check_snmp.c

@@ -241,7 +241,7 @@ main (int argc, char **argv)
 	if (process_arguments (argc, argv) == ERROR)
 		usage4 (_("Could not parse arguments"));
 	
-	command_interval = timeout_interval / retries;
+	command_interval = timeout_interval / retries + 1;
 	if (command_interval < 1) {
 		usage4 (_("Command timeout must be 1 second or greater. Please increase timeout (-t) value or decrease retries (-e) value."));
 		exit (STATE_UNKNOWN);