mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-22 00:49: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
@ -97,9 +97,10 @@ bool MatchCIDR(const char* address, const char* cidr_mask, bool match_with_usern
|
||||
* of the @ symbol in each */
|
||||
char* address_dupe = strdup(address);
|
||||
char* cidr_dupe = strdup(cidr_mask);
|
||||
|
||||
char* username_mask_pos = strchr(cidr_dupe, '@');
|
||||
char* username_addr_pos = strchr(address_dupe, '@');
|
||||
|
||||
/* Use strchr not strrchr, because its going to be nearer to the left */
|
||||
char* username_mask_pos = strrchr(cidr_dupe, '@');
|
||||
char* username_addr_pos = strrchr(address_dupe, '@');
|
||||
|
||||
/* Both strings have an @ symbol in them */
|
||||
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;
|
||||
|
||||
|
||||
char* bits_chars = strchr(mask,'/');
|
||||
/* Use strrchr for this, its nearer to the right */
|
||||
char* bits_chars = strrchr(mask,'/');
|
||||
|
||||
if (bits_chars)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user