mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-24 09:59:02 -04:00
Change to strrchr when looking for '/'. faster
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4749 e03df62e-2008-0410-955e-edbf42e46eb7
This commit is contained in:
parent
afb5e20d25
commit
55cf774593
@ -98,8 +98,9 @@ bool MatchCIDR(const char* address, const char* cidr_mask, bool match_with_usern
|
|||||||
char* address_dupe = strdup(address);
|
char* address_dupe = strdup(address);
|
||||||
char* cidr_dupe = strdup(cidr_mask);
|
char* cidr_dupe = strdup(cidr_mask);
|
||||||
|
|
||||||
char* username_mask_pos = strchr(cidr_dupe, '@');
|
/* Use strchr not strrchr, because its going to be nearer to the left */
|
||||||
char* username_addr_pos = strchr(address_dupe, '@');
|
char* username_mask_pos = strrchr(cidr_dupe, '@');
|
||||||
|
char* username_addr_pos = strrchr(address_dupe, '@');
|
||||||
|
|
||||||
/* Both strings have an @ symbol in them */
|
/* Both strings have an @ symbol in them */
|
||||||
if (username_mask_pos && username_addr_pos)
|
if (username_mask_pos && username_addr_pos)
|
||||||
@ -142,7 +143,8 @@ bool MatchCIDR(const char* address, const char* cidr_mask, bool match_with_usern
|
|||||||
in_addr mask_in4;
|
in_addr mask_in4;
|
||||||
|
|
||||||
|
|
||||||
char* bits_chars = strchr(mask,'/');
|
/* Use strrchr for this, its nearer to the right */
|
||||||
|
char* bits_chars = strrchr(mask,'/');
|
||||||
|
|
||||||
if (bits_chars)
|
if (bits_chars)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user