summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-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;