predict is more robust
[pspp] / src / language / control / repeat.c
index bba14c6c7bdb3c1bd6febb6a50a99498a0f9d152..6cfbb6bba5cbc3ff911f81c09b3828488c8bcb52 100644 (file)
 
 #include <config.h>
 #include "repeat.h"
-#include "message.h"
+#include <libpspp/message.h>
 #include <ctype.h>
 #include <math.h>
 #include <stdlib.h>
-#include "alloc.h"
-#include "command.h"
-#include "dictionary.h"
-#include "message.h"
-#include "line-buffer.h"
-#include "lexer.h"
-#include "misc.h"
-#include "pool.h"
-#include "settings.h"
-#include "str.h"
-#include "variable.h"
+#include <libpspp/alloc.h>
+#include <language/command.h>
+#include <data/dictionary.h>
+#include "intprops.h"
+#include <libpspp/message.h>
+#include <language/line-buffer.h>
+#include <language/lexer/lexer.h>
+#include <libpspp/misc.h>
+#include <libpspp/pool.h>
+#include <data/settings.h>
+#include <libpspp/str.h>
+#include <data/variable.h>
 
 #include "gettext.h"
 #define _(msgid) gettext (msgid)
 
-#include "debug-print.h"
+#include <libpspp/debug-print.h>
 
 /* Defines a list of lines used by DO REPEAT. */
 struct line_list
@@ -363,7 +364,7 @@ parse_ids (struct repeat_entry *e)
 static inline void
 store_numeric (char **repl, long value)
 {
-  *repl = xmalloc (INT_DIGITS + 1);
+  *repl = xmalloc (INT_STRLEN_BOUND (value) + 1);
   sprintf (*repl, "%ld", value);
 }
 
@@ -561,7 +562,7 @@ do_repeat_read (struct string *output, char **file_name, int *line_number,
     }
   line = block->cur_line;
 
-  ds_replace (output, line->line);
+  ds_assign_c_str (output, line->line);
   *file_name = line->file_name;
   *line_number = -line->line_number;
   block->cur_line = line->next;