Hi,

On Mon, 19 Jan 2009 16:43:28 -0200 Fernando M. Maresca wrote:

> Ok, it's a locale problem related to the defintion of the decimal-point
> char.
> In both i386 and adm64 boxes my LC_* definition is es_AR.UTF-8. Changing
> that to LC_ALL="C" makes xnecview work.
> In es_AR.UTF-8 the decimal-point char is ',' (comma) not '.'
> (point/period).
> 
> I think that calling setlocale(LC_ALL, "C") before sscanf may do the
> trick, because regardless of the locale settings of the user, all .nec
> files will be using '.' as decimal-point char always.

Yupp, now I can reproduce it by setting LC_ALL to de_DE.UTF-8 (I have
en_US.UTF-8 here normally).
And yepp² calling setlocale() helps.

See the attached debdiff for a proposed NMU.

Regards
Evgeni

-- 
Bruce Schneier Fact Number 853:
Perfect Forward Secrecy is when Bruce Schneier whispers something in
your ear.
diff -u xnecview-1.35/debian/changelog xnecview-1.35/debian/changelog
--- xnecview-1.35/debian/changelog
+++ xnecview-1.35/debian/changelog
@@ -1,3 +1,11 @@
+xnecview (1.35-5.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Always use C locale to prevent different decimal-point chars.
+    Closes: #511852.
+
+ -- Evgeni Golov <sarge...@die-welt.net>  Mon, 19 Jan 2009 20:07:15 +0100
+
 xnecview (1.35-5) unstable; urgency=low
   * Fix md5sums file
   * Change strip options to remove .comment and .note sections
only in patch2:
unchanged:
--- xnecview-1.35.orig/xnecview.c
+++ xnecview-1.35/xnecview.c
@@ -15,6 +15,8 @@
 #include <string.h>
 #include <math.h>
 
+#include <locale.h>
+
 #ifndef NO_GETOPT
   #include <getopt.h>
 #endif
@@ -373,6 +375,8 @@
    initX(&argc,argv);
    inputfilename=NULL;
 
+   setlocale(LC_ALL, "C");
+
    wires=mymalloc(maxwires*sizeof(Wire));
    surfaces=mymalloc(maxsurfaces*sizeof(Surface));
    excis=mymalloc(maxexcis*sizeof(Exci));

Attachment: pgpNVappQPM3M.pgp
Description: PGP signature

Reply via email to