fixed small language "bug"
[NeonServV5.git] / UserNode.c
index 3b18cbd0e1c55d7ef254790b2576ce3a4257d166..5b6c9c11259c79019d5e7d7a562f656be786ab33 100644 (file)
@@ -195,7 +195,23 @@ struct UserNode* createTempUser(const char *mask) {
             strcpy(user->ident, &cmask[ii]);
             ii = i+1;
         } else if(cmask[i] == '\0') {
-            if(user == NULL) return NULL;
+            if(user == NULL) {
+                //nick only
+                user = malloc(sizeof(*user));
+                if (!user)
+                {
+                    perror("malloc() failed");
+                    return NULL;
+                }
+                strcpy(user->nick, cmask);
+                user->created = time(0);
+                user->ident[0] = 0;
+                user->host[0] = 0;
+                user->realname[0] = 0;
+                user->flags = 0;
+                user->channel = NULL;
+                return user;
+            }
             strcpy(user->host, &cmask[ii]);
         }
     }