From 7770530829708d091629a71abcdba808ab73f830 Mon Sep 17 00:00:00 2001 From: Holger Weiss Date: Sat, 31 Mar 2007 17:29:50 +0000 Subject: Avoid division by zero. git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1664 f882894a-f735-0410-b71e-b25c423dba1c diff --git a/plugins/check_ntp.c b/plugins/check_ntp.c index 013c24b..861d0ba 100644 --- a/plugins/check_ntp.c +++ b/plugins/check_ntp.c @@ -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); -- cgit v0.10-9-g596f