diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-02-07 18:26:38 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2006-02-07 18:26:38 +0000 |
commit | dba88edc767697f9c2a9de3c4c2fbaea6cc35f3e (patch) | |
tree | 74122d2f9666219c8b4bd047604711f5a2772fa5 /src/modules.cpp | |
parent | daff96bf568a51de4e4ec460240e093c43b11ff3 (diff) |
Experimental improved string handling in server links
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3127 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules.cpp')
-rw-r--r-- | src/modules.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/modules.cpp b/src/modules.cpp index 38b84c2bd..b1ac75f8f 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -778,26 +778,26 @@ long Server::CalcDuration(std::string delta) bool Server::IsValidMask(std::string mask) { - const char* dest = mask.c_str(); + char* dest = (char*)mask.c_str(); if (strchr(dest,'!')==0) return false; if (strchr(dest,'@')==0) return false; - for (unsigned int i = 0; i < strlen(dest); i++) - if (dest[i] < 32) + for (char* i = dest; *i; i++) + if (*i < 32) return false; - for (unsigned int i = 0; i < strlen(dest); i++) - if (dest[i] > 126) + for (char* i = dest; *i; i++) + if (*i > 126) return false; unsigned int c = 0; - for (unsigned int i = 0; i < strlen(dest); i++) - if (dest[i] == '!') + for (char* i = dest; *i; i++) + if (*i == '!') c++; if (c>1) return false; c = 0; - for (unsigned int i = 0; i < strlen(dest); i++) - if (dest[i] == '@') + for (char* i = dest; *i; i++) + if (*i == '@') c++; if (c>1) return false; @@ -893,9 +893,9 @@ long ConfigReader::ReadInteger(std::string tag, std::string name, int index, boo this->error = CONF_VALUE_NOT_FOUND; return 0; } - for (unsigned int i = 0; i < strlen(val); i++) + for (char* i = val; *i; i++) { - if (!isdigit(val[i])) + if (!isdigit(*i)) { this->error = CONF_NOT_A_NUMBER; return 0; |