Re: XForms: browser object

Steve Lamont (spl@szechuan.ucsd.edu)
Mon, 27 Sep 99 06:22:53 PDT

# To subscribers of the xforms list from spl@szechuan.ucsd.edu (Steve Lamont) :

> The version is 0.88
>
> The attached file contains two lines. The second line (beginning "10.."is
> where the crash occurs.
>
> I have been using CR (ASCII 13) to delimit the colour, with success.

Ah. I've seen this one before.

The problem is that XForms sees the concatenated string. Your color
index is concatenated with the number in your line of text. So, if
you do something like

sprintf( buffer1, "@C%i", color );
strncat( buffer1, buffer, 512 );

where `buffer' begins with one or more digits, XForms has no way of
knowing that it isn't all one number. It then does something stupid
with the color index and causes the program to break.

The trick I've used is to use an invalid format code to separate the
color from the text of the line. For example:

sprintf( buffer1, "@C%i@x", color );
strncat( buffer1, buffer, 512 );

should do it.

There really should be some sort specific delimiter code. XForms
should also probably check for the validity of the "@C" value and not
barf on its shoes if it finds a bad one.

TC?

spl
_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuhs.mil or see
http://bob.usuhs.mil/mailserv/xforms.html
XForms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuhs.mil/mailserv/list-archives/