If the last point in the spline does not fulfill with the wantedDistance restriction, the last segment is not copied to splineDest. Possible solution:
if j == splineSrc.getNumPoints() -1) && (length < wantedDistanceSquared
{
splineDest->addPoint(end);
break;
}