Problem with readline

Fairlight fairlite at fairlite.com
Tue Apr 7 09:47:27 PDT 2009


Only Alan Mazuti would say something like:
> opendir commands succeeds and fn contains a valid filename and xa="1".  As
> soon as It hits the ab=readline(xa,ln) I get the segmentation error.
> 
> ::xa(8,#)                         'Array subscript':
> ::ln(80,*)                        'Text line':

You're casting "ln" as 80 long.  I suspect you're hitting a line longer
than 80.  It is documented that it should use the length of the field but
it sounds like a bounds checking bug was introduced.

Two potential workarounds depending on your goal:

1) Specify a 3rd argument, "80", for readline if you really only want the
first 80 characters.

2) Use "ln" uncast, and specify "32767" as the third argument to readline.
That will give you the full line to the NL, and resize the field.

This assumes the bug is only of medium severity.  These might not work if
it's really hosed badly.

mark->
-- 
"I'm not subtle. I'm not pretty, and I'll piss off a lot of people along
the way. But I'll get the job done" --Captain Matthew Gideon, "Crusade"


More information about the Filepro-list mailing list