]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
Fix reported number of runs to correspond to reported number of samples
authorMiroslav Lichvar <mlichvar@redhat.com>
Fri, 25 Nov 2011 14:49:35 +0000 (15:49 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Mon, 28 Nov 2011 10:19:48 +0000 (11:19 +0100)
regress.c

index 9322d1ff4dd6766895582284249241fc50187ad4..cd5edbd482ca3ad66beef7a9015549477520580f 100644 (file)
--- a/regress.c
+++ b/regress.c
@@ -300,9 +300,9 @@ RGR_FindBestRegression
     nruns = n_runs_from_residuals(resid, n - resid_start); 
 
     if (nruns > critical_runs[n - resid_start] || n - start <= MIN_SAMPLES_FOR_REGRESS) {
-      if (resid_start < 0) {
+      if (start != resid_start) {
         /* Ignore extra samples in returned nruns */
-        nruns = n_runs_from_residuals(resid - resid_start, n); 
+        nruns = n_runs_from_residuals(resid - resid_start + start, n - start);
       }
       break;
     } else {