summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2014-12-31 10:55:52 +0000
committerKirill Volinsky <mataes2007@gmail.com>2014-12-31 10:55:52 +0000
commit6cc54049b4e7ba48787758c5332341df6f93be81 (patch)
treee4712db18280f6099d804abff84739cb7b8c3f7a
parentcad77e7d51aef2c4d938fca592921e14d923f8c5 (diff)
minor fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@11692 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/DbEditorPP/src/exportimport.cpp2
-rw-r--r--plugins/DbEditorPP/src/findwindow.cpp8
-rw-r--r--plugins/DbEditorPP/src/watchedvars.cpp4
3 files changed, 8 insertions, 6 deletions
diff --git a/plugins/DbEditorPP/src/exportimport.cpp b/plugins/DbEditorPP/src/exportimport.cpp
index eb151581c3..60c1853d13 100644
--- a/plugins/DbEditorPP/src/exportimport.cpp
+++ b/plugins/DbEditorPP/src/exportimport.cpp
@@ -13,7 +13,7 @@ static int Openfile(TCHAR *outputFile, const char *module)
if (module) {
int n = 0;
- mir_strncpy(filename, module, MAX_PATH);
+ mir_strncpy(filename, module, SIZEOF(filename));
while (filename[n]) {
switch (filename[n]) {
diff --git a/plugins/DbEditorPP/src/findwindow.cpp b/plugins/DbEditorPP/src/findwindow.cpp
index 7071322571..d49c185cc8 100644
--- a/plugins/DbEditorPP/src/findwindow.cpp
+++ b/plugins/DbEditorPP/src/findwindow.cpp
@@ -204,7 +204,7 @@ void ItemFound(HWND hwnd, MCONTACT hContact, const char *module, const char *set
mir_snprintf(text, SIZEOF(text), Translate("%s Module \"%s\" in contact \"%s\""), mode, module, name);
break;
case FW_SETTINGNAME:
- mir_strncpy(ii->setting, setting, 256);
+ mir_strncpy(ii->setting, setting, SIZEOF(ii->setting));
ii->type = FW_SETTINGNAME;
if (GetValue(hContact, module, setting, szValue, SIZEOF(szValue)))
mir_snprintf(text, SIZEOF(text), Translate("%s Setting \"%s\" in module \"%s\" in contact \"%s\" - \"%s\""), mode, setting, module, name, szValue);
@@ -212,7 +212,7 @@ void ItemFound(HWND hwnd, MCONTACT hContact, const char *module, const char *set
mir_snprintf(text, SIZEOF(text), Translate("%s Setting \"%s\" in module \"%s\" in contact \"%s\""), mode, setting, module, name);
break;
case FW_SETTINGVALUE:
- mir_strncpy(ii->setting, setting, 256);
+ mir_strncpy(ii->setting, setting, SIZEOF(ii->setting));
ii->type = FW_SETTINGVALUE;
mir_snprintf(text, SIZEOF(text), Translate("%s \"%s\" in Setting \"%s\" in module \"%s\" in contact \"%s\""), mode, value, setting, module, name);
break;
@@ -225,7 +225,7 @@ void ItemFound(HWND hwnd, MCONTACT hContact, const char *module, const char *set
}
else {
ii->hContact = hContact;
- mir_strncpy(ii->module, module, 256);
+ mir_strncpy(ii->module, module, SIZEOF(ii->module));
SendMessage(hwnd, LB_SETITEMDATA, index, (LPARAM)ii);
}
}
@@ -364,6 +364,8 @@ int replaceSetting(HWND hwnd, MCONTACT hContact, const char *module, const char
}
else db_free(&dbv2);
+ mir_free(myreplace);
+
return count;
}
diff --git a/plugins/DbEditorPP/src/watchedvars.cpp b/plugins/DbEditorPP/src/watchedvars.cpp
index 18250c4f09..d5a6ce476a 100644
--- a/plugins/DbEditorPP/src/watchedvars.cpp
+++ b/plugins/DbEditorPP/src/watchedvars.cpp
@@ -331,8 +331,8 @@ void popupWatchedVar(MCONTACT hContact, const char* module, const char* setting)
POPUPDATA ppd = { 0 };
ppd.lchContact = (MCONTACT)hContact;
ppd.lchIcon = hIcon;
- mir_tstrncpy(ppd.lpzContactName, lpzContactName, MAX_CONTACTNAME);
- mir_tstrncpy(ppd.lpzText, lpzText, MAX_SECONDLINE);
+ mir_tstrncpy(ppd.lpzContactName, lpzContactName, SIZEOF(ppd.lpzContactName));
+ mir_tstrncpy(ppd.lpzText, lpzText, SIZEOF(ppd.lpzText));
ppd.colorBack = colorBack;
ppd.colorText = colorText;
ppd.iSeconds = timeout ? timeout : -1;