regress: avoid undefined behavior in pointer arithmetic

This commit is contained in:
Miroslav Lichvar 2017-07-21 17:13:24 +02:00
parent c2ab1426e5
commit f6e72a80e1

View file

@ -285,7 +285,7 @@ RGR_FindBestRegression
n - start <= min_samples) {
if (start != resid_start) {
/* Ignore extra samples in returned nruns */
nruns = n_runs_from_residuals(resid - resid_start + start, n - start);
nruns = n_runs_from_residuals(resid + (start - resid_start), n - start);
}
break;
} else {