slang-users mailing list

[2004 Date Index] [2004 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

[slang-users] slang2: Bug in integer()/hex_atoul()


Hi,

I found a bug in integer():

#v+
$ xjed-2.0 -batch -l ~/slang-bug.sl 
loading /home/joerg/programmieren/jed-B0.99-17.56/lib/site.slgned on a short wor
loading /home/joerg/programmieren/jed-B0.99-17.56/lib/os.sl
loading /home/joerg/programmieren/jed-B0.99-17.56/lib/menus.sla short integer.  
loading /etc/jed.conf
loading /etc/jed-init.d/00debian.sl format above.  A value of -1 or -2 means the
loading /etc/jed-init.d/05home-lib.slt->string_offsets + 2 * offset);
loading /etc/jed-init.d/55ispell.slt->numbers + 2 * offset);
loading /home/joerg/programmieren/jed-B0.99-17.56/lib/sl_utils.sl
loading /var/cache/dictionaries-common/jed-ispell-dicts.sl
loading /home/joerg/.jed/jed.rcnteger (*(int **) ptr);
loading /home/joerg/programmieren/jed-B0.99-17.56/lib/colors/black3.sl
loading /home/joerg/programmieren/jed-B0.99-17.56/lib/keydefs.sl
loading /home/joerg/programmieren/jed-B0.99-17.56/lib/compress.sl
loading /home/joerg/slang-bug.sl
xx:4
xx:
$ cat ~/slang-bug.sl

define bla()
{
   variable foo="xx:";
   
   try {
     foo += string( integer( () ) +4 );
   } catch ParseError;
   message(foo);
}

bla("hoelder");
bla("xhoelder");
#v-

The problem is in hex_atoul() because the tailing h is used for something
- I don't know what. But it isn't checked if there are any numbers before
'h' (or u or l). So integer("h") == 0.

Joerg.

-- 
Der Klügere gibt so lange nach bis er der Dumme ist.

_______________________________________________
To unsubscribe, visit http://jedsoft.org/slang/mailinglists.html


[2004 date index] [2004 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]