X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcidr.cpp;h=fb4ab447bebc2626b2cdeeb4aa4d6341685e7026;hb=4ca5fb1994541181f940a692bce47eb11d681e7a;hp=90654ee820e70da4a5d95c27bd4c8dc00868cb49;hpb=03ef675c0dd4742464d8ad93888e98721a044108;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/cidr.cpp b/src/cidr.cpp index 90654ee82..fb4ab447b 100644 --- a/src/cidr.cpp +++ b/src/cidr.cpp @@ -11,7 +11,7 @@ * --------------------------------------------------- */ -/* $Core: libIRCDcidr */ +/* $Core */ #include "inspircd.h" #include "wildcard.h" @@ -100,6 +100,11 @@ bool irc::sockets::MatchCIDR(const std::string &address, const std::string &cidr cidr_copy = cidr_mask.substr(username_mask_pos + 1); } } + else + { + address_copy.assign(address); + cidr_copy.assign(cidr_mask); + } in_addr address_in4; in_addr mask_in4; @@ -109,6 +114,7 @@ bool irc::sockets::MatchCIDR(const std::string &address, const std::string &cidr if (bits_chars != std::string::npos) { bits = atoi(cidr_copy.substr(bits_chars + 1).c_str()); + cidr_copy.erase(bits_chars, cidr_copy.length() - bits_chars); } else {