Avoid compiler warning
authorJohn Darrington <john@darrington.wattle.id.au>
Sat, 18 Jul 2009 11:38:49 +0000 (13:38 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Sat, 18 Jul 2009 11:38:49 +0000 (13:38 +0200)
Smake
src/math/interaction.c

diff --git a/Smake b/Smake
index 201474ce9993a2e8eed1144442945457aec80449..2697064c98a3eacdc8ec4cfe1ef35d99111fb4ee 100644 (file)
--- a/Smake
+++ b/Smake
@@ -77,6 +77,7 @@ GNULIB_MODULES = \
        unilbrk/ulc-width-linebreaks \
        unistd \
        unistr/u8-strlen \
+       unistr/u8-strncat \
        unlocked-io \
        vasprintf-posix \
        vfprintf-posix \
index 7911c8e74d3166bb48e3f0ab4dde771fbd16652f..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]))