]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - src/substitution.c
Fix an off by one error with zipstats processing
[irc/rqf/shadowircd.git] / src / substitution.c
index 58deefabc30a2f9a4a5d60a13a356a3cb0236ba0..37fc3404b05586a5b13c9b15b1187f8379749bf1 100644 (file)
@@ -35,7 +35,8 @@
 
 #include "stdinc.h"
 #include "s_user.h"
-#include "irc_string.h"
+#include "match.h"
+#include "substitution.h"
 
 /*
  * Simple mappings for $foo -> 'bar'.
@@ -59,8 +60,8 @@ void substitution_append_var(rb_dlink_list *varlist, const char *name, const cha
 {
        struct substitution_variable *tmp = rb_malloc(sizeof(struct substitution_variable));
 
-       DupString(tmp->name, name);
-       DupString(tmp->value, value);
+       tmp->name = rb_strdup(name);
+       tmp->value = rb_strdup(value);
 
        rb_dlinkAddAlloc(tmp, varlist);
 }
@@ -136,7 +137,7 @@ char *substitution_parse(const char *fmt, rb_dlink_list *varlist)
 
                                if (!strcasecmp(varname, val->name))
                                {
-                                       strlcpy(bptr, val->value, BUFSIZE - (bptr - buf));
+                                       rb_strlcpy(bptr, val->value, BUFSIZE - (bptr - buf));
                                        bptr += strlen(val->value);
                                        break;
                                }