Re: Crashing g_string_sprintf when printing invalid floats. gtk+-1.2.9 on Linux
- From: "Eric M. Monsler" <emonsler beamreachnetworks com>
- To: Chris Wareham <chris wareham iosystems co uk>
- Cc: Allin Cottrell <cottrell wfu edu>, "gtk-list gnome org" <gtk-list gnome org>
- Subject: Re: Crashing g_string_sprintf when printing invalid floats. gtk+-1.2.9 on Linux
- Date: Wed, 14 Aug 2002 09:54:17 -0700
Yes. I understand the limitations of strtod.
Much of this thread could have been avoided if I had used:
f_val = 6.2e-21;
f_val *= 1.0e-21;
in my example code. I used the union example because that's how I found
the problem, I used the double to float cast because that's how I tested
that the compiler thought I had a reasonable floating point value, and
it still crashed.
Can we pretend my example was:
f_val = 6.2e-21;
f_val *= 1.0e-21;
g_string_sprtinf(pGStr,"%6.2f",f_val);
instead?
Two valid floats, a valid operation, a valid format string of "%6.2f", a
call to g_string_sprintf() from which control never returns.
Eric
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]