GNOME Bugzilla – Bug 461804
don't use setlocale
Last modified: 2008-07-24 13:26:04 UTC
Nautilus uses setlocale (LC_NUMERIC, "C") to temporarily switch locale just to printf a float. It should use g_ascii_dtostr instead!
Created attachment 92705 [details] [review] patch use g_ascii_dtostr/strtod and g_ascii_strtoll, instead of fiddling with the locale.
What I don't get about this: why is position_good not flagged as being potentially uninitialized by gcc? What am I missing?
Created attachment 92780 [details] [review] fix initialisation You're right, it was being used uninitialised; the new patch fixes that.
Comment on attachment 92780 [details] [review] fix initialisation Sorry, I just noticed another thing: Why are you replacing the position sscanf() at all? Like the comment states, the whole locale radix thingy is just about floats, isn't it?
Hmm right, maybe the scanf parts of the patch aren't needed.
Created attachment 111147 [details] [review] updated patch Patch updated with the comments from Martin.
Committed to trunk. 2008-07-24 Cosimo Cecchi <cosimoc@gnome.org> * src/file-manager/fm-icon-view.c: (get_stored_icon_position_callback), (icon_position_changed_callback): Don't use setlocale () just to printf a float, but use g_ascii_dtostr () instead. Initial patch by Christian Persch (#461804).