]> jfr.im git - irc/quakenet/newserv.git/blobdiff - core/modules.c
add my version of trusts, trusts_newsearch, trusts_search modules
[irc/quakenet/newserv.git] / core / modules.c
index 4b9de8b6ac3dba4144b875b1c33ad6c314d77730..4063669dfe1a7ae57500e9f5aff9ab28677d4089 100644 (file)
@@ -390,19 +390,21 @@ void setreloadmark(struct module_dep *mdp) {
 void preparereload(char *modulename) {
   unsigned int i;
   struct module_dep *mdp;
-  
-  delchars(modulename,"./\\;");
+  char modulebuf[1024];
+
+  strlcpy(modulebuf, modulename, sizeof(modulebuf));
+  delchars(modulebuf,"./\\;");
   
   /* First, clear the mark off all dependant modules */
   for (i=0;i<knownmodules;i++)
     moduledeps[i].reloading=0;
 
   /* Do nothing if this module is not loaded */
-  i=getindex(modulename);
+  i=getindex(modulebuf);
   if (i<0)
     return;
     
-  if ((mdp=getmoduledep(modulename))) {
+  if ((mdp=getmoduledep(modulebuf))) {
     setreloadmark(mdp);
   }
 }