From 792f8a011a9aceb3dc0a83770f9b39786f8cc90a Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 5 Feb 2006 20:52:41 +0000 Subject: Fixed two unneccessary strlcpy's in the wildcard matching that just were there to lowercase it... we can do this inplace git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3100 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/wildcard.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/wildcard.cpp b/src/wildcard.cpp index 06fc78b43..1b1f874ab 100644 --- a/src/wildcard.cpp +++ b/src/wildcard.cpp @@ -22,6 +22,8 @@ using namespace std; #include "helperfuncs.h" #include "inspstring.h" +extern char lowermap[255]; + // Wed 27 Apr 2005 - Brain // I've taken our our old wildcard routine - // although comprehensive, it was topheavy and very @@ -57,7 +59,7 @@ int wildcmp(char *wild, char *string) cp = string+1; } else - if ((*wild == *string) || (*wild == '?')) + if ((lowermap[(unsigned)*wild] == lowermap[(unsigned)*string]) || (*wild == '?')) { wild++; string++; @@ -86,11 +88,6 @@ int wildcmp(char *wild, char *string) bool match(const char* literal, const char* mask) { - static char L[10240]; - static char M[10240]; - strlcpy(L,literal,10240); - strlcpy(M,mask,10240); - strlower(L); - strlower(M); - return wildcmp(M,L); + return wildcmp((char*)mask, (char*)literal); } + -- cgit v1.2.3