From: Miroslav Lichvar Date: Tue, 5 Apr 2011 14:32:50 +0000 (+0200) Subject: Don't update empty sourcestats on clock update X-Git-Tag: 1.25-pre2~18 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=faec23f6bd3fdd6052e0140b1028df52cd823101;p=thirdparty%2Fchrony.git Don't update empty sourcestats on clock update --- diff --git a/sourcestats.c b/sourcestats.c index 7a7d3e80..ec34b8db 100644 --- a/sourcestats.c +++ b/sourcestats.c @@ -619,6 +619,9 @@ SST_SlewSamples(SST_Stats inst, struct timeval *when, double dfreq, double doffs struct timeval *sample, prev; double prev_offset, prev_freq; + if (!inst->n_samples) + return; + for (m = -inst->runs_samples; m < inst->n_samples; m++) { i = get_runsbuf_index(inst, m); sample = &(inst->sample_times[i]);