summaryrefslogtreecommitdiff
path: root/plugins/Spamotron
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2015-05-22 10:18:21 +0000
committerKirill Volinsky <mataes2007@gmail.com>2015-05-22 10:18:21 +0000
commitb499ebc740aa5480be013d40e0d8097066800642 (patch)
treeed410ee863f4afc0c579599741bf38b4e3ffb706 /plugins/Spamotron
parent5a17c9299e03bebf46169927abdeee34aaf8e854 (diff)
replace _tcslen to mir_tstrlen
git-svn-id: http://svn.miranda-ng.org/main/trunk@13748 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Spamotron')
-rw-r--r--plugins/Spamotron/src/options.cpp10
-rw-r--r--plugins/Spamotron/src/spamotron.cpp6
-rw-r--r--plugins/Spamotron/src/utils.cpp26
3 files changed, 21 insertions, 21 deletions
diff --git a/plugins/Spamotron/src/options.cpp b/plugins/Spamotron/src/options.cpp
index dee33a833c..47c231ab6f 100644
--- a/plugins/Spamotron/src/options.cpp
+++ b/plugins/Spamotron/src/options.cpp
@@ -7,9 +7,9 @@ TCHAR* _getCOptS(TCHAR *buf, unsigned int buflen, MCONTACT hContact, const char*
DBVARIANT dbv = {0};
_tcsnset(buf, 0, buflen);
if (db_get_ts(hContact, PLUGIN_NAME, option, &dbv) != 0)
- _tcsncpy(buf, def, min(buflen, _tcslen(def)+1));
+ _tcsncpy(buf, def, min(buflen, mir_tstrlen(def)+1));
else if (dbv.type == DBVT_TCHAR) {
- _tcsncpy(buf, dbv.ptszVal, min(buflen, _tcslen(dbv.ptszVal)+1));
+ _tcsncpy(buf, dbv.ptszVal, min(buflen, mir_tstrlen(dbv.ptszVal)+1));
}
db_free(&dbv);
return buf;
@@ -20,12 +20,12 @@ TCHAR* _getMOptS(TCHAR *buf, unsigned int buflen, const char* module, const char
DBVARIANT dbv = {0};
_tcsnset(buf, 0, buflen);
if (db_get_s(NULL, module, option, &dbv) != 0)
- _tcsncpy(buf, def, min(buflen, _tcslen(def)+1));
+ _tcsncpy(buf, def, min(buflen, mir_tstrlen(def)+1));
else if (dbv.type == DBVT_TCHAR) {
- _tcsncpy(buf, dbv.ptszVal, min(buflen, _tcslen(dbv.ptszVal)+1));
+ _tcsncpy(buf, dbv.ptszVal, min(buflen, mir_tstrlen(dbv.ptszVal)+1));
} else {
tmp = mir_a2u(dbv.pszVal);
- _tcsncpy(buf, tmp, min(buflen, _tcslen(tmp)+1));
+ _tcsncpy(buf, tmp, min(buflen, mir_tstrlen(tmp)+1));
mir_free(tmp);
}
db_free(&dbv);
diff --git a/plugins/Spamotron/src/spamotron.cpp b/plugins/Spamotron/src/spamotron.cpp
index f37ae252db..0a0b6a77e0 100644
--- a/plugins/Spamotron/src/spamotron.cpp
+++ b/plugins/Spamotron/src/spamotron.cpp
@@ -194,7 +194,7 @@ int OnDBEventFilterAdd(WPARAM wParam, LPARAM lParam)
bCorrectResponse = TRUE;
} else {
if (_tcsstr_cc(message, buf, _getOptB("ResponseCC", defaultResponseCC)) &&
- (_tcslen(message) == _tcslen(buf)))
+ (mir_tstrlen(message) == mir_tstrlen(buf)))
bCorrectResponse = TRUE;
}
break;
@@ -211,7 +211,7 @@ int OnDBEventFilterAdd(WPARAM wParam, LPARAM lParam)
}
} else {
if (_tcsstr_cc(message, buf, _getOptB("ResponseCC", defaultResponseCC)) &&
- (_tcslen(message) == _tcslen(buf))) {
+ (mir_tstrlen(message) == mir_tstrlen(buf))) {
bCorrectResponse = TRUE;
break;
}
@@ -223,7 +223,7 @@ int OnDBEventFilterAdd(WPARAM wParam, LPARAM lParam)
if (message == NULL)
break;
_itot(_getCOptD(hContact, "ResponseMath", -1), buf, 10);
- if (_tcsstr(message, buf) && (_tcslen(buf) == _tcslen(message))) {
+ if (_tcsstr(message, buf) && (mir_tstrlen(buf) == mir_tstrlen(message))) {
bCorrectResponse = TRUE;
}
break;
diff --git a/plugins/Spamotron/src/utils.cpp b/plugins/Spamotron/src/utils.cpp
index 81d1493fa7..2c8ba48df7 100644
--- a/plugins/Spamotron/src/utils.cpp
+++ b/plugins/Spamotron/src/utils.cpp
@@ -7,7 +7,7 @@ TCHAR *_tcstolower(TCHAR *dst)
if (dst == NULL)
return NULL;
- SIZE_T dst_len = _tcslen(dst);
+ SIZE_T dst_len = mir_tstrlen(dst);
for (SIZE_T i = 0; i < dst_len; i ++)
dst[i] = _totlower(dst[i]);
return dst;
@@ -18,7 +18,7 @@ TCHAR *_tcstoupper(TCHAR *dst)
if (dst == NULL)
return NULL;
- SIZE_T dst_len = _tcslen(dst);
+ SIZE_T dst_len = mir_tstrlen(dst);
for (SIZE_T i = 0; i < dst_len; i ++)
dst[i] = _totupper(dst[i]);
return dst;
@@ -42,7 +42,7 @@ BOOL _isregex(TCHAR* strSearch)
regex = mir_tstrdup(strSearch);
if (regex == NULL)
goto err_out;
- rc = pcre16_exec(re, NULL, regex, (int)_tcslen(regex), 0, 0, ovector, 9);
+ rc = pcre16_exec(re, NULL, regex, (int)mir_tstrlen(regex), 0, 0, ovector, 9);
if (rc == 3)
ret = TRUE;
mir_free(regex);
@@ -73,7 +73,7 @@ BOOL _isvalidregex(TCHAR* strSearch)
pcre16_free(re);
return FALSE;
}
- rc = pcre16_exec(re, NULL, regex, (int)_tcslen(regex), 0, 0, ovector, 9);
+ rc = pcre16_exec(re, NULL, regex, (int)mir_tstrlen(regex), 0, 0, ovector, 9);
pcre16_free(re);
if (rc != 3)
goto err_out;
@@ -121,7 +121,7 @@ BOOL _regmatch(TCHAR* str, TCHAR* strSearch)
pcre16_free(re);
return FALSE;
}
- rc = pcre16_exec(re, NULL, regex, (int)_tcslen(regex), 0, 0, ovector, 9);
+ rc = pcre16_exec(re, NULL, regex, (int)mir_tstrlen(regex), 0, 0, ovector, 9);
pcre16_free(re);
if (rc != 3)
goto err_out; // [TODO] and log some error (better check for valid regex on options save)
@@ -143,7 +143,7 @@ BOOL _regmatch(TCHAR* str, TCHAR* strSearch)
re = pcre16_compile(regexp, opts, &error, &erroroffs, NULL);
if (re == NULL)
goto err_out;
- rc = pcre16_exec(re, NULL, data, (int)_tcslen(data), 0, 0, NULL, 0);
+ rc = pcre16_exec(re, NULL, data, (int)mir_tstrlen(data), 0, 0, NULL, 0);
pcre16_free(re);
if (rc >= 0)
ret = TRUE;
@@ -175,7 +175,7 @@ int get_response_id(const TCHAR* strvar)
pcre16_free(re);
return 0;
}
- rc = pcre16_exec(re, NULL, _strvar, (int)_tcslen(_strvar), 0, 0, ovector, 9);
+ rc = pcre16_exec(re, NULL, _strvar, (int)mir_tstrlen(_strvar), 0, 0, ovector, 9);
pcre16_free(re);
if (rc < 0) {
ret = -1;
@@ -274,10 +274,10 @@ BOOL Contains(TCHAR* dst, TCHAR* src) // Checks for occurence of substring from
if (tdst == NULL)
goto err_out;
tdst = _tcstoupper(tdst);
- dst_len = _tcslen(tdst);
+ dst_len = mir_tstrlen(tdst);
token = _tcstok(tsrc, _T(","));
while (token) {
- token_end = (token + _tcslen(token));
+ token_end = (token + mir_tstrlen(token));
while (!_tcsncmp(token, _T(" "), 1)) { /* Skeep spaces at start. */
token ++;
}
@@ -329,9 +329,9 @@ TCHAR* ReplaceVar(TCHAR *dst, unsigned int len, const TCHAR *var, const TCHAR *r
if (dst == NULL || var == NULL || rvar == NULL)
return NULL;
- dst_len = _tcslen(dst);
- var_len = _tcslen(var);
- rvar_len = _tcslen(rvar);
+ dst_len = mir_tstrlen(dst);
+ var_len = mir_tstrlen(var);
+ rvar_len = mir_tstrlen(rvar);
var_start = _tcsstr(dst, var);
while (var_start) {
if (len < (dst_len + rvar_len - var_len + 1))
@@ -390,7 +390,7 @@ TCHAR* ReplaceVarsNum(TCHAR *dst, unsigned int len, int num)
mir_free(dstcopy);
goto err_out;
}
- rc = pcre16_exec(re, NULL, _str, (int)_tcslen(_str), 0, 0, ovector, 9);
+ rc = pcre16_exec(re, NULL, _str, (int)mir_tstrlen(_str), 0, 0, ovector, 9);
if (rc < 0) {
ret = -1;
} else if (rc == 3) {