summaryrefslogtreecommitdiff
path: root/plugins/Clist_nicer
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-07-25 23:10:36 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-07-25 23:10:36 +0300
commita411a7391bb879db8da398f067245a13c7fa7aee (patch)
tree4b2c76ca8bc0b43b1084b8234746810c3ef6c446 /plugins/Clist_nicer
parent942c498d6e8901f751b088c0adfcb8f3fc67576c (diff)
major code cleaning of all font-related structures
Diffstat (limited to 'plugins/Clist_nicer')
-rw-r--r--plugins/Clist_nicer/src/clui.cpp39
1 files changed, 19 insertions, 20 deletions
diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp
index f2ee3b3ae7..affee6a037 100644
--- a/plugins/Clist_nicer/src/clui.cpp
+++ b/plugins/Clist_nicer/src/clui.cpp
@@ -1871,9 +1871,9 @@ static clistFontDescr[] =
void FS_RegisterFonts()
{
- FontIDW fid = { sizeof(fid) };
- wcsncpy(fid.group, LPGENW("Contact list"), _countof(fid.group));
- strncpy(fid.dbSettingsGroup, "CLC", 5);
+ FontIDW fid = {};
+ wcsncpy_s(fid.group, LPGENW("Contact list"), _TRUNCATE);
+ strncpy_s(fid.dbSettingsGroup, "CLC", _TRUNCATE);
fid.flags = FIDF_DEFAULTVALID | FIDF_ALLOWEFFECTS | FIDF_APPENDNAME | FIDF_SAVEPOINTSIZE;
HDC hdc = GetDC(nullptr);
@@ -1890,49 +1890,48 @@ void FS_RegisterFonts()
fid.flags &= ~FIDF_CLASSMASK;
fid.flags |= clistFontDescr[i].iMask;
- wcsncpy(fid.name, clistFontDescr[i].tszName, _countof(fid.name));
+ wcsncpy_s(fid.name, clistFontDescr[i].tszName, _TRUNCATE);
char idstr[10];
mir_snprintf(idstr, "Font%d", i);
- strncpy(fid.prefix, idstr, _countof(fid.prefix));
+ strncpy_s(fid.setting, idstr, _TRUNCATE);
fid.order = i;
g_plugin.addFont(&fid);
}
ReleaseDC(nullptr, hdc);
// and colours
- ColourIDW colourid = { 0 };
- colourid.cbSize = sizeof(colourid);
+ ColourIDW colourid = {};
colourid.order = 0;
- strncpy(colourid.dbSettingsGroup, "CLC", sizeof(colourid.dbSettingsGroup));
+ strncpy_s(colourid.dbSettingsGroup, "CLC", _TRUNCATE);
- strncpy(colourid.setting, "BkColour", sizeof(colourid.setting));
- wcsncpy(colourid.name, LPGENW("Background"), _countof(colourid.name));
- wcsncpy(colourid.group, LPGENW("Contact list"), _countof(colourid.group));
+ strncpy_s(colourid.setting, "BkColour", _TRUNCATE);
+ wcsncpy_s(colourid.name, LPGENW("Background"), _TRUNCATE);
+ wcsncpy_s(colourid.group, LPGENW("Contact list"), _TRUNCATE);
colourid.defcolour = CLCDEFAULT_BKCOLOUR;
g_plugin.addColor(&colourid);
- strncpy(colourid.setting, "SelTextColour", sizeof(colourid.setting));
- wcsncpy(colourid.name, LPGENW("Selected text"), _countof(colourid.name));
+ strncpy_s(colourid.setting, "SelTextColour", _TRUNCATE);
+ wcsncpy_s(colourid.name, LPGENW("Selected text"), _TRUNCATE);
colourid.order = 1;
colourid.defcolour = CLCDEFAULT_SELTEXTCOLOUR;
g_plugin.addColor(&colourid);
- strncpy(colourid.setting, "HotTextColour", sizeof(colourid.setting));
- wcsncpy(colourid.name, LPGENW("Hottrack text"), _countof(colourid.name));
+ strncpy_s(colourid.setting, "HotTextColour", _TRUNCATE);
+ wcsncpy_s(colourid.name, LPGENW("Hottrack text"), _TRUNCATE);
colourid.order = 1;
colourid.defcolour = CLCDEFAULT_HOTTEXTCOLOUR;
g_plugin.addColor(&colourid);
- strncpy(colourid.setting, "QuickSearchColour", sizeof(colourid.setting));
- wcsncpy(colourid.name, LPGENW("Quicksearch text"), _countof(colourid.name));
+ strncpy_s(colourid.setting, "QuickSearchColour", _TRUNCATE);
+ wcsncpy_s(colourid.name, LPGENW("Quicksearch text"), _TRUNCATE);
colourid.order = 1;
colourid.defcolour = CLCDEFAULT_QUICKSEARCHCOLOUR;
g_plugin.addColor(&colourid);
- strncpy(colourid.dbSettingsGroup, "CLUI", sizeof(colourid.dbSettingsGroup));
- strncpy(colourid.setting, "clr_frameborder", sizeof(colourid.setting));
- wcsncpy(colourid.name, LPGENW("Embedded frames border"), _countof(colourid.name));
+ strncpy_s(colourid.dbSettingsGroup, "CLUI", _TRUNCATE);
+ strncpy_s(colourid.setting, "clr_frameborder", _TRUNCATE);
+ wcsncpy_s(colourid.name, LPGENW("Embedded frames border"), _TRUNCATE);
colourid.order = 1;
colourid.defcolour = RGB(40, 40, 40);
g_plugin.addColor(&colourid);