summaryrefslogtreecommitdiff
path: root/plugins/Variables/src/parse_str.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-03-30 17:32:39 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-03-30 17:32:39 +0000
commit109877a3c75cb290c55755dcfc88794d2453669d (patch)
tree3ede8b9170b2fc3f6f35dc2cea6742d44b19d631 /plugins/Variables/src/parse_str.cpp
parentfee8d991bdf4a59b563d1b92165ea0ed2f7bacb8 (diff)
MS_DB_EVENT_* services remained, but their calls removed
git-svn-id: http://svn.miranda-ng.org/main/trunk@4255 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Variables/src/parse_str.cpp')
-rw-r--r--plugins/Variables/src/parse_str.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/plugins/Variables/src/parse_str.cpp b/plugins/Variables/src/parse_str.cpp
index 37b8c4af4b..3061ae7bf6 100644
--- a/plugins/Variables/src/parse_str.cpp
+++ b/plugins/Variables/src/parse_str.cpp
@@ -633,15 +633,14 @@ static TCHAR *parseSubstr(ARGUMENTSINFO *ai) {
return NULL;
}
from = max(ttoi(ai->targv[2])-1, 0);
- if (ai->argc > 3) {
- to = min(ttoi(ai->targv[3]), (signed int)_tcslen(ai->targv[1]));
- }
- else {
- to = _tcslen(ai->targv[1]);
- }
- if (to < from) {
+ if (ai->argc > 3)
+ to = min(ttoi(ai->targv[3]), (int)_tcslen(ai->targv[1]));
+ else
+ to = (int)_tcslen(ai->targv[1]);
+
+ if (to < from)
return NULL;
- }
+
res = (TCHAR*)mir_alloc((to-from+1)*sizeof(TCHAR));
ZeroMemory(res, (to-from+1)*sizeof(TCHAR));
_tcsncpy(res, ai->targv[1]+from, to-from);