output-item: Add missing new-line printing tables in output_item_dump().
[pspp] / src / output / output-item.c
index 97f51f7604ff4bac4b57912527c95e20fd3f2ee0..a4328b52e99725be3d9d568db3c31f4adfc8495b 100644 (file)
@@ -360,13 +360,17 @@ output_item_dump (const struct output_item *item, int indentation)
       break;
 
     case OUTPUT_ITEM_TABLE:
+      printf ("table\n");
       pivot_table_dump (item->table, indentation + 1);
       break;
 
     case OUTPUT_ITEM_TEXT:
-      printf ("text %s \"%s\"\n",
-              text_item_subtype_to_string (item->text.subtype),
-              pivot_value_to_string_defaults (item->text.content));
+      {
+        char *s = pivot_value_to_string_defaults (item->text.content);
+        printf ("text %s \"%s\"\n",
+                text_item_subtype_to_string (item->text.subtype), s);
+        free (s);
+      }
       break;
     }
 }
@@ -598,7 +602,7 @@ text_item_create_value (enum text_item_subtype subtype,
       ex->font_style->typeface = xstrdup ("Monospaced");
     }
 
-  struct output_item *item = xzalloc (sizeof *item);
+  struct output_item *item = XZALLOC (struct output_item);
   *item = (struct output_item) {
     OUTPUT_ITEM_INITIALIZER (OUTPUT_ITEM_TEXT),
     .command_name = xstrdup_if_nonnull (output_get_command_name ()),