summaryrefslogtreecommitdiff
path: root/plugins/Variables/src/parse_str.cpp
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2015-01-10 18:44:06 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2015-01-10 18:44:06 +0000
commit2cd05c2649104e8690defdcf0122d8c3e827c1d2 (patch)
treee778d1ebc66f1942eab066d8de5b0a77e612ef5f /plugins/Variables/src/parse_str.cpp
parente5972722ef981be64fe46ca8c07c2c403458e255 (diff)
Variables:
- Fixed various memory leaks git-svn-id: http://svn.miranda-ng.org/main/trunk@11821 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Variables/src/parse_str.cpp')
-rw-r--r--plugins/Variables/src/parse_str.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/plugins/Variables/src/parse_str.cpp b/plugins/Variables/src/parse_str.cpp
index 28df138d44..0f6cb00b0d 100644
--- a/plugins/Variables/src/parse_str.cpp
+++ b/plugins/Variables/src/parse_str.cpp
@@ -211,7 +211,7 @@ static TCHAR *parseLineCount(ARGUMENTSINFO *ai)
TCHAR *cur = ai->targv[1];
while (cur < (ai->targv[1] + _tcslen(ai->targv[1]))) {
if (!_tcsncmp(cur, _T("\r\n"), 2)) {
- count += 1;
+ count++;
cur++;
}
else if (*cur == '\n')
@@ -700,13 +700,13 @@ static TCHAR *getNthWord(TCHAR *szString, int w)
while (*scur == ' ')
scur++;
- count += 1;
+ count++;
while ((count < w) && (scur < szString + _tcslen(szString))) {
if (*scur == ' ') {
while (*scur == ' ')
scur++;
- count += 1;
+ count++;
}
if (count < w)
scur++;
@@ -751,15 +751,15 @@ static TCHAR *parseWord(ARGUMENTSINFO *ai)
return res;
if (res != NULL) {
- res = (TCHAR*)mir_realloc(res, (_tcslen(res) + _tcslen(szWord) + 2)*sizeof(TCHAR));
- if (res != NULL) {
+ TCHAR *pres = (TCHAR*)mir_realloc(res, (_tcslen(res) + _tcslen(szWord) + 2)*sizeof(TCHAR));
+ if (pres != NULL) {
+ res = pres;
_tcscat(res, _T(" "));
_tcscat(res, szWord);
}
+ mir_free(szWord);
}
- else res = mir_tstrdup(szWord);
-
- mir_free(szWord);
+ else res = szWord;
}
return res;