change empty fields to NULL (* later) on make_banmask
authorpk910 <philipp@zoelle1.de>
Sun, 28 Aug 2011 10:43:33 +0000 (12:43 +0200)
committerpk910 <philipp@zoelle1.de>
Sun, 28 Aug 2011 10:43:33 +0000 (12:43 +0200)
tools.c

diff --git a/tools.c b/tools.c
index 93fbd323e2c42d56e6c4455711e6628a6034f326..3701358b3f32f28c7ecdfbfe08cab7414b90d2b8 100644 (file)
--- a/tools.c
+++ b/tools.c
@@ -436,6 +436,9 @@ char* make_banmask(char *input, char* buffer) {
         else
             nick = input;
     }
+    if(*nick == '\0') nick = NULL;
+    if(*ident == '\0') ident = NULL;
+    if(*host == '\0') host = NULL;
     sprintf(buffer, "%s!%s@%s", (nick ? nick : "*"), (ident ? ident : "*"), (host ? host : "*"));
     return buffer;
 }