]> jfr.im git - irc/quakenet/newserv.git/blobdiff - lib/sstring-new.c
Implement --help parameter.
[irc/quakenet/newserv.git] / lib / sstring-new.c
index afaa9e7c3c1d78dfc016dec26923e2d21cb4bbf3..90581f93af0b93ae2c0cea65d9e5637b26424f8b 100644 (file)
@@ -13,7 +13,7 @@
 
 #include <assert.h>
 #include <stdlib.h>
-#define __USE_GNU
+#define _GNU_SOURCE
 #include <string.h>
 
 /* List of free stuff */
@@ -81,11 +81,15 @@ void initsstring() {
   registerhook(HOOK_CORE_STATSREQUEST,&sstringstats);
 }
 
-#ifndef SSTRING_MMAP
 void finisstring() {
+  deregisterhook(HOOK_CORE_STATSREQUEST,&sstringstats);
+
+  #ifndef SSTRING_MMAP
   nsfreeall(POOL_SSTRING);
+  #endif /* SSTRING_MMAP */ 
 }
 
+#ifndef SSTRING_MMAP
 static void salloc(void) {
   ssmem=(char *)nsmalloc(POOL_SSTRING, SSTRING_ALLOC);
   ssmemfree=SSTRING_ALLOC;