X-Git-Url: https://jfr.im/git/irc/quakenet/newserv.git/blobdiff_plain/fb89902c76f105818b2a323bb2ecfefaaae7b6e7..0d6366b6a61a69b26dc0cde44eb85e3293c6659d:/glines/glines_formats.c diff --git a/glines/glines_formats.c b/glines/glines_formats.c index 6f98b6f3..6a1649fc 100644 --- a/glines/glines_formats.c +++ b/glines/glines_formats.c @@ -81,7 +81,10 @@ gline *makegline(const char *mask) { } gl->flags |= GLINE_REALNAME; - gl->user = getsstring(mask + 2, REALLEN); + + if (strcmp(mask + 2, "*") != 0) + gl->user = getsstring(mask + 2, REALLEN); + return gl; } @@ -101,7 +104,7 @@ gline *makegline(const char *mask) { count++; if (count >= 8) { - controlwall(NO_OPER, NL_GLINES, "Warning: Parsed invalid IPv6 G-Line: %s", mask); + controlwall(NO_OPER, NL_GLINES_AUTO, "Warning: Parsed invalid IPv6 G-Line: %s", mask); freegline(gl); return NULL; } @@ -122,11 +125,7 @@ char *glinetostring(gline *gl) { static char mask[512]; /* check */ if (gl->flags & GLINE_REALNAME) { - if (gl->user) - snprintf(mask, sizeof(mask), "$R%s", gl->user->content); - else - strncpy(mask, "$R*", sizeof(mask)); - + snprintf(mask, sizeof(mask), "$R%s", (gl->user) ? gl->user->content : "*"); return mask; }