]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - bandb/bantool.c
Fix viconf's dependencies on setup.h and config.h.
[irc/rqf/shadowircd.git] / bandb / bantool.c
index 8714742091a6da4e1df9340e2d48f13ec8c0c4cf..81797449491465384a78317ecb1db0e2af4e5d0c 100644 (file)
  *
  */
 
-#define _XOPEN_SOURCE
 #include <stdio.h>
 #include <stdlib.h>
 #include <time.h>
 
 #include "stdinc.h"
+#include "common.h"
 #include "rsdb.h"
 
 #define EmptyString(x) ((x == NULL) || (*(x) == '\0'))
@@ -389,12 +389,12 @@ import_config(const char *conf, int id)
        int i = 0;
 
        char f_perm = 0;
-       char *f_mask1 = NULL;
-       char *f_mask2 = NULL;
-       char *f_oper = NULL;
-       char *f_time = NULL;
-       char *f_reason = NULL;
-       char *f_oreason = NULL;
+       const char *f_mask1 = NULL;
+       const char *f_mask2 = NULL;
+       const char *f_oper = NULL;
+       const char *f_time = NULL;
+       const char *f_reason = NULL;
+       const char *f_oreason = NULL;
        char newreason[REASONLEN];
 
        if(flag.verbose)
@@ -479,6 +479,8 @@ import_config(const char *conf, int id)
 
                f_oper = getfield(NULL);
                f_time = strip_quotes(f_oper + strlen(f_oper) + 2);
+               if(EmptyString(f_oper))
+                       f_oper = "unknown";
 
                /* meh */
                if(id == BANDB_KLINE || id == BANDB_KLINE_PERM)