Fix for crash where ride time is shorter than smoothing. In particular, the

sample ride is shorter than the default smoothing value.
This commit is contained in:
Sean C. Rhea
2007-01-29 19:59:04 +00:00
parent c89e81077b
commit 7c6fe559f0

View File

@@ -90,7 +90,8 @@ AllPlot::recalc()
double *smoothSpeed = new double[rideTimeSecs + 1];
double *smoothCad = new double[rideTimeSecs + 1];
double *smoothTime = new double[rideTimeSecs + 1];
for (int secs = 0; secs < smooth; ++secs) {
for (int secs = 0; ((secs < smooth)
&& (secs < rideTimeSecs)); ++secs) {
smoothWatts[secs] = 0.0;
smoothHr[secs] = 0.0;
smoothSpeed[secs] = 0.0;