aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/check_ntp.c2
-rw-r--r--plugins/check_ntp_time.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/plugins/check_ntp.c b/plugins/check_ntp.c
index 6607b4b4..0a7640a7 100644
--- a/plugins/check_ntp.c
+++ b/plugins/check_ntp.c
@@ -482,7 +482,7 @@ double offset_request(const char *host, int *status){
} else {
/* finally, calculate the average offset */
for(i=0; i<servers[best_index].num_responses;i++){
- avg_offset+=servers[best_index].offset[j];
+ avg_offset+=servers[best_index].offset[i];
}
avg_offset/=servers[best_index].num_responses;
}
diff --git a/plugins/check_ntp_time.c b/plugins/check_ntp_time.c
index f8564571..72dffbd8 100644
--- a/plugins/check_ntp_time.c
+++ b/plugins/check_ntp_time.c
@@ -428,7 +428,7 @@ double offset_request(const char *host, int *status){
} else {
/* finally, calculate the average offset */
for(i=0; i<servers[best_index].num_responses;i++){
- avg_offset+=servers[best_index].offset[j];
+ avg_offset+=servers[best_index].offset[i];
}
avg_offset/=servers[best_index].num_responses;
}