X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=profile.c;h=3f3dd42bc108f1c0b7e048a1521388e92e1a7c2d;hb=7a8fe91690f31d9b4af6e041574c55028d928bc1;hp=531839368bf4cd53b89c386ef84a5c15c5b02078;hpb=957aaf619f22465b4aa1898c925831a6270c1230;p=ext%2Fsubsurface.git diff --git a/profile.c b/profile.c index 5318393..3f3dd42 100644 --- a/profile.c +++ b/profile.c @@ -620,7 +620,7 @@ static struct plot_info *analyze_plot_info(struct plot_info *pi) /* if our samples are short and we aren't too FAST*/ if (entry[0].sec - entry[-1].sec < 30 && entry->velocity < FAST) { int past = -2; - while (pi->entry <= entry-past && entry[0].sec - entry[past].sec < 30) + while (i+past > 0 && entry[0].sec - entry[past].sec < 30) past--; entry->velocity = velocity((entry[0].val - entry[past].val) / (entry[0].sec - entry[past].sec)); @@ -743,4 +743,5 @@ void plot(struct graphics_context *gc, int w, int h, struct dive *dive) cairo_close_path(gc->cr); cairo_stroke(gc->cr); + free(pi); }