diff options
author | Tobias Weimer <wishmaster51@googlemail.com> | 2014-12-12 09:00:02 +0000 |
---|---|---|
committer | Tobias Weimer <wishmaster51@googlemail.com> | 2014-12-12 09:00:02 +0000 |
commit | 266e4e01e879d02f16fa1940aaeaa29b0990756d (patch) | |
tree | 534cc7da925a51a0106c8df53d86329256c1c244 /plugins/NewXstatusNotify/src/main.cpp | |
parent | 4f57c77f78480ac20879d4ab1b10c47ec99666bf (diff) |
NewXStatusNotify:
-Fixed warnings
-Fixed possible crashes
git-svn-id: http://svn.miranda-ng.org/main/trunk@11340 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/NewXstatusNotify/src/main.cpp')
-rw-r--r-- | plugins/NewXstatusNotify/src/main.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp index 0356a5cab3..d1adcb6c87 100644 --- a/plugins/NewXstatusNotify/src/main.cpp +++ b/plugins/NewXstatusNotify/src/main.cpp @@ -182,16 +182,15 @@ static int CompareStatusMsg(STATUSMSGINFO *smi, DBCONTACTWRITESETTING *cws_new, TCHAR *GetStr(STATUSMSGINFO *n, const TCHAR *tmplt)
{
- TCHAR tmp[1024];
-
- if (tmplt == NULL || tmplt[0] == _T('\0'))
+ if (n == NULL || tmplt == NULL || tmplt[0] == _T('\0'))
return NULL;
TCHAR *str = (TCHAR *)mir_alloc(2048 * sizeof(TCHAR));
str[0] = _T('\0');
- int len = mir_tstrlen(tmplt);
+ size_t len = mir_tstrlen(tmplt);
- for (int i = 0; i < len; i++) {
+ TCHAR tmp[1024];
+ for (size_t i = 0; i < len; i++) {
tmp[0] = _T('\0');
if (tmplt[i] == _T('%')) {
|