X-Git-Url: https://jfr.im/git/irc/quakenet/newserv.git/blobdiff_plain/923bc30c7c899fcb17abc189a8c3bdc890518d46..0d6366b6a61a69b26dc0cde44eb85e3293c6659d:/glines/glines_store.c diff --git a/glines/glines_store.c b/glines/glines_store.c index bf65d5a5..a52f51bc 100644 --- a/glines/glines_store.c +++ b/glines/glines_store.c @@ -1,8 +1,11 @@ #include +#include "../lib/version.h" #include "../core/schedule.h" #include "../control/control.h" #include "glines.h" +MODULE_VERSION(""); + static int glstore_savefile(const char *file) { FILE *fp; gline *gl; @@ -19,7 +22,7 @@ static int glstore_savefile(const char *file) { fprintf(fp, "%s %jd,%jd,%jd,%d,%s,%s\n", glinetostring(gl), (intmax_t)gl->expire, (intmax_t)gl->lastmod, (intmax_t)gl->lifetime, (gl->flags & GLINE_ACTIVE) ? 1 : 0, - gl->creator->content, gl->reason->content); + gl->creator->content, gl->reason ? gl->reason->content : ""); count++; } @@ -60,7 +63,7 @@ static int glstore_loadfile(const char *file) { gl->creator = getsstring(creator, 512); - gl->flags = active ? GLINE_ACTIVE : 0; + gl->flags |= active ? GLINE_ACTIVE : 0; gl->reason = getsstring(reason, 512); gl->expire = expire; @@ -71,6 +74,8 @@ static int glstore_loadfile(const char *file) { glinelist = gl; } + fclose(fp); + return count; }