This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
Re: Bug found
- To: Remy Bruno <remy dot bruno at libertysurf dot fr>
- Subject: Re: Bug found
- From: Brian Gough <bjg at network-theory dot co dot uk>
- Date: Thu, 8 Mar 2001 15:50:14 +0000 (GMT)
- Cc: gsl-discuss at sources dot redhat dot com
- References: <20010307140921.A8445@litani>
- Reply-To: gsl-discuss at sources dot redhat dot com
Thanks for the bug report, I've corrected the code.
Remy Bruno writes:
> Hi, I have found a bug in gsl.
> In file multifit/lmpar.c, in function compute_newton_direction,
> the "for (j = nsing - 1; j > 0; j--)" statement isn't correct: as j
> is declared as size_t and size_t (at least on my sun station, but I
> think on linux, it is the same) is an unsigned int type, if nsing
> is 0 (which can apparently happen), j will start at INT_MAX-1 and
> the loop will begin in spite of the "j > 0" condition.
> A quite simple solution is to add a "if (nsing>0)" in front of
> this statement, but maybe using a simple "int" instead of a size_t
> for loop counters would be better?
> Best regards, Rémy BRUNO
>