Re: XForms: X Error Messages (detailed)

Steve Lamont (spl@szechuan.ucsd.edu)
Wed, 27 Oct 99 09:56:17 PDT

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

> There is also something weird in all of this, if I
> enter the values into the float input field like this:
> 123456.7890 there is no problem at all. The problem
> presents itself when I enter the values like this:
> 1.2345e+02, as far as I understand this should'nt be a
> problem.

This is something of a guess since I'm away from my lab at the moment
and unable to run any experiments but I wonder if the fact that you
have have the return set to ALWAYS is perhaps the culprit. If you are
evaluating the string at every keystroke it may be that you are at
some point evaluating a number that is not valid, causing atof() to
return some strange huge value (it shouldn't but who knows). This
would cause the sprintf() to possibly do something wacky and overflow
your buffer, which is relatively small.

You might try ussing strtod() instead. You can check the return for
validity before doing the sprintf().

As I say, this is a guess, since I'm not able to test my theory at the
moment.

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/