Code

Avoid division by zero.
authorHolger Weiss <hweiss@users.sourceforge.net>
Sat, 31 Mar 2007 17:29:50 +0000 (17:29 +0000)
committerHolger Weiss <hweiss@users.sourceforge.net>
Sat, 31 Mar 2007 17:29:50 +0000 (17:29 +0000)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1664 f882894a-f735-0410-b71e-b25c423dba1c

plugins/check_ntp.c

index 013c24bbbc9574d193695c75e48b4bdf124e75e1..861d0ba43eda140ea7111c1c39dedac13d8cad9e 100644 (file)
@@ -608,7 +608,7 @@ double jitter_request(const char *host, int *status){
                }
        }
 
-       rval /= num_valid;
+       rval = num_valid ? rval / num_valid : -1.0;
 
        close(conn);
        free(peers);