data_out function to dynamically allocate return value.
[pspp-builds.git] / src / ui / gui / text-data-import-dialog.c
index dac8b4c1e0a5c0ad8cb22ef0887b85375eefe94b..8eebf9775677954e17f0a19f73ca9a8273a16e45 100644 (file)
@@ -1768,10 +1768,7 @@ parse_field (struct import_assistant *ia,
     }
   if (outputp != NULL)
     {
-      char *output = xmalloc (out.w + 1);
-      data_out (&val, &out, output);
-      output[out.w] = '\0';
-      *outputp = output;
+      *outputp = data_out (&val, &out);
     }
   value_destroy (&val, var_get_width (var));