[Geany] utils_strtod, invalid_test + patch

Enrico Tröger enrico.troeger at xxxxx
Mon May 22 00:08:05 UTC 2006


On Mon, 22 May 2006 01:57:50 +0200, Pierre <pierre.php at gmail.com> wrote:

> 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)
> 
> It always crashes here. You cannot compare a value lower than 0 (>=0
> may end to <0) if you use a unsigned integer. It may work in many
This convinced me. Ok, now it is a signed integer.

> I can give you another version which does not use any integer but
> decrement the pointer until it reaches the beginning of string, it is
> safe and platform independent.
Even better. I just wrote this down to the TODO list, but I you have
already the code, it would be nice to see it.

regards,
Enrico

-- 
Get my GPG key from http://www.uvena.de/pub.key
Geany, a lightweight IDE using GTK2 - http://geany.uvena.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
URL: <http://lists.geany.org/pipermail/users/attachments/20060522/49d8c444/attachment.pgp>


More information about the Users mailing list