[Geany] utils_strtod, invalid_test + patch

Pierre pierre.php at xxxxx
Mon May 22 00:02:32 UTC 2006


On 5/22/06, Enrico Tröger <enrico.troeger at uvena.de> wrote:
> On Mon, 22 May 2006 01:19:08 +0200, Pierre <pierre.php at gmail.com> wrote:
>
> > Hello,
> Hi,
>
> > A little fix fpr utils_strtod. It should use integer if it needs to
> > test values lower than 0 (<= 0 incl.). A better fix would be to use
> when gets i lower than 0? I think unsigned int is ok. When i is lower
> than 0, there must be a bigger problem than the integer underflow ;-).
> (correct me if I'm wrong)

I sent my reply too early. Here is a little example (values of i using
 6 chars):
5
4
3
2
1
0
FFFFFFFF

The last line would actually be "-1" but it is not. It is out of the
int range, on many platform it will be seen as a positive integer.

I hope I'm more clear now :)

Cheers,
--Pierre



More information about the Users mailing list