From 1a025e4fbd56afe7c55bd33579c072da7565550e Mon Sep 17 00:00:00 2001 From: Mukund Sivaraman Date: Fri, 6 May 2011 19:47:41 +0530 Subject: [PATCH] selection-to-path: Fix an uninitialized variable --- plug-ins/selection-to-path/fit.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plug-ins/selection-to-path/fit.c b/plug-ins/selection-to-path/fit.c index 26f1f3a98e..747db0c7ae 100644 --- a/plug-ins/selection-to-path/fit.c +++ b/plug-ins/selection-to-path/fit.c @@ -20,6 +20,7 @@ #include "config.h" +#include #include #include #include @@ -1111,6 +1112,13 @@ fit_with_least_squares (curve_type curve) real previous_error = FLT_MAX; real improvement = FLT_MAX; + /* FIXME: Initialize best_spline to zeroes. This is strictly not + necessary as best_spline is always set in the loop below. But the + compiler thinks it isn't and warns. Ideally, the code should be + rewritten such that best_spline and best_error are initialized with + the first values before the loop begins. */ + memset (&best_spline, 0, sizeof best_spline); + /* LOG ("\nFitting with least squares:\n"); */ /* Phoenix reduces the number of points with a ``linear spline