X-Git-Url: https://jfr.im/git/irc/rqf/shadowircd.git/blobdiff_plain/90a3c35b295b07ebe3793bf5d3b882c3c1a5dc7c..70f227af69a6b5d27f62d0cd15f188b2d777f17d:/src/substitution.c diff --git a/src/substitution.c b/src/substitution.c index 5cef86b..37fc340 100644 --- a/src/substitution.c +++ b/src/substitution.c @@ -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'. @@ -57,10 +58,10 @@ struct substitution_variable */ void substitution_append_var(rb_dlink_list *varlist, const char *name, const char *value) { - struct substitution_variable *tmp = MyMalloc(sizeof(struct substitution_variable)); + 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; }