X-Git-Url: https://jfr.im/git/irc/rqf/shadowircd.git/blobdiff_plain/8e69bb4e903f428b14e2950cce9be39dc8ddd12c..40114db23cd832ebaa721a1c6307869eb666d9a0:/src/substitution.c diff --git a/src/substitution.c b/src/substitution.c index e6d48c4..708dce2 100644 --- a/src/substitution.c +++ b/src/substitution.c @@ -34,10 +34,10 @@ */ #include "stdinc.h" -#include "tools.h" -#include "balloc.h" #include "s_user.h" -#include "irc_string.h" +#include "snomask.h" +#include "match.h" +#include "substitution.h" /* * Simple mappings for $foo -> 'bar'. @@ -59,10 +59,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); } @@ -83,9 +83,9 @@ void substitution_free(rb_dlink_list *varlist) struct substitution_variable *tmp = (struct substitution_variable *) nptr->data; rb_dlinkDelete(nptr, varlist); - MyFree(tmp->name); - MyFree(tmp->value); - MyFree(tmp); + rb_free(tmp->name); + rb_free(tmp->value); + rb_free(tmp); } } @@ -138,7 +138,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; }