Autorecode: use locale independent printf function
authorJohn Darrington <john@darrington.wattle.id.au>
Sun, 23 Dec 2012 20:15:26 +0000 (21:15 +0100)
committerJohn Darrington <john@darrington.wattle.id.au>
Sun, 23 Dec 2012 20:15:26 +0000 (21:15 +0100)
src/language/stats/autorecode.c

index 95fb8d173c5661f3a79e06b948457510a8d9e0da..736d1e6852dd662bbf98d7024de03f86ca222a90 100644 (file)
 #include "libpspp/str.h"
 
 #include "gl/xalloc.h"
-#include "gl/vasnprintf.h"
+#include "gl/c-vasprintf.h"
 #include "gl/mbiter.h"
 
+
 #include "gettext.h"
 #define _(msgid) gettext (msgid)
 
@@ -295,7 +296,6 @@ cmd_autorecode (struct lexer *lexer, struct dataset *ds)
       for (j = 0; j < n_items; j++)
        {
          const union value *from = &items[j]->from;
-         size_t len;
          char *recoded_value  = NULL;
          char *c;
          const int src_width = items[j]->width;
@@ -315,7 +315,7 @@ cmd_autorecode (struct lexer *lexer, struct dataset *ds)
              recoded_value = recode_string (UTF8, dict_get_encoding (arc->dict), str, src_width);
            }
          else
-           recoded_value = asnprintf (NULL, &len, "%g", from->f);
+           recoded_value = c_xasprintf ("%g", from->f);
          
          /* Remove trailing whitespace */
          for (c = recoded_value; *c != '\0'; c++)