Re: XForms: browser object

Peter Hanley (peter@hanley.demon.co.uk)
Wed, 22 Sep 1999 10:00:13 +0100 (BST)

# To subscribers of the xforms list from Peter Hanley <peter@hanley.demon.co.uk> :

On Tue, 21 Sep 1999, T.C. Zhao wrote:

>
> I don't know how big BUFFER_SIZE is, but you really should be
> doing BUFFER_SIZE-1, and manually set the last char to 0
> as strncpy() does not append the null character.

Thanks to TC and Michael.

This is not the problem however!
I found that the 'crash point' was independent of buffer size, and
printing out index and buffer content showed everything as expected.

Remming out the "fl_replace_browser_line()" statement stopped the crashes
however.

The problem seems to be when the first characters of the line combines
with the the "@Cxx" to give something which can't be handled. I have
cured the problem by delimiting the colour number with a space:

sprintf(buffer2, "@C%i ",COLOUR);
strncat(buffer2, buffer1, BUFFER_SIZE);
fl_replace_browser_line(file_viewer, i, buffer2);

This is OK, but the selected lines are now displaced one character to the
right.
Is there a better, invisable way of delimiting the colour?

Thanks

Peter Hanley

==============================================================================
Western Lodge, Parkend +44 01594 562817
Lydney peter@hanley.demon.co.uk
Gloucestershire GL15 4JQ
UK
==============================================================================

_________________________________________________
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/