Avoid compiler warning
[pspp-builds.git] / src / math / interaction.c
index cd151097d6242408c93a31dc877e4f6faffc8345..7ed36f6627ed469ce1c6775efd504a191c23f338 100644 (file)
@@ -38,6 +38,7 @@
 #include <math/interaction.h>
 #include <string.h>
 #include <xalloc.h>
+#include <unistr.h>
 
 struct interaction_variable
 {
@@ -148,8 +149,8 @@ interaction_value_create (const struct interaction_variable *var, const union va
   
   if (var != NULL)
     {
-      int val_width = 1;
       uint8_t *val;
+      int val_width = 1;
 
       result = xmalloc (sizeof (*result));
       result->intr = var;
@@ -174,7 +175,7 @@ interaction_value_create (const struct interaction_variable *var, const union va
                {
                   int w = var_get_width (var->members[i]);
                  value_resize (result, val_width, val_width + w);
-                 strncat (val, value_str (vals[i], w), w);
+                 u8_strncat (val, value_str (vals[i], w), w);
                  val = value_str_rw (&result->val, val_width);
                }
              else if (var_is_numeric (var->members[i]))
@@ -246,12 +247,10 @@ interaction_case_data (const struct ccase *ccase, const struct interaction_varia
 {
   size_t i;
   size_t n_vars;
-  const struct variable *intr;
   const struct variable *member;
   const union value **vals = NULL;
 
   n_vars = interaction_get_n_vars (iv);
-  intr = interaction_get_variable (iv);
   vals = xnmalloc (n_vars, sizeof (*vals));
 
   for (i = 0; i < n_vars; i++)