[XForms] strange side effect of fl_initialize()

Jürg Hauser juerg.hauser at krist.unibe.ch
Thu Oct 14 10:41:47 EDT 2004



I've tried to parse the string
" SYOP     1 0 0 0.0000000    0 1 0 0.0000000    0 0 1 0.0000000"
with rc=sscanf(str,"%*10c%d%d%d%f %d%d%d%f  %d%d%d%f ", ...) and get rc=4.
LC_NUMERIC and all other LC_* are set to "de_DE.UTF-8".
If call in my application after fl_initialize(...) setlocale(LC_NUMERIC,
"POSIX") sscanf works fine.
Juerg

>
> I think I remember reading about this on this mail list in the past. If
I'm not mistaken, setlocale() affects how sscanf reads numbers as far as
things like using a "," or a "." to read decimal points, and other things
probably. Could you be a little more specific about the "strange results"?
>
> Jason
>
> > Jürg> To subscribers of the xforms list Hi all, I'm trying to move a
> > Jürg> program which runs on IRIX and RedHat 7.3 to SuSE 9.1. The
> > Jürg> program fails because a sscanf() instruction not involved in any
> > Jürg> Xforms business gives strange results. If I remove
> > Jürg> fl_initialize() (and all other fl_ instructions) sscanf() works
> > Jürg> prefectly well. If I add fl_initalize() only again, sscanf()
> > Jürg> behaves strange again. I've tried XForms 1.0 and 1.0.90. Any
> > Jürg> ideas?
> >
> > A wild guess: fl_initialize calls setlocale(LC_ALL,""). Could it be
> > that it affects sscanf()?
> >
> > JMarc





More information about the Xforms mailing list