diff options
author | George Hazan <george.hazan@gmail.com> | 2015-06-19 19:35:42 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-06-19 19:35:42 +0000 |
commit | 4c814798c7bc7f6a0f92c21b027b26290622aa2f (patch) | |
tree | 9bbfb38bd639f352300aa16ff7c45f5a9b2dba6d /plugins/Popup/src/notifications.cpp | |
parent | f0f0cd088f1ec3a85abee825ddbc214f3f6b92c3 (diff) |
SIZEOF replaced with more secure analog - _countof
git-svn-id: http://svn.miranda-ng.org/main/trunk@14270 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Popup/src/notifications.cpp')
-rw-r--r-- | plugins/Popup/src/notifications.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/plugins/Popup/src/notifications.cpp b/plugins/Popup/src/notifications.cpp index 6f355f68a5..a1e25be5f6 100644 --- a/plugins/Popup/src/notifications.cpp +++ b/plugins/Popup/src/notifications.cpp @@ -185,30 +185,30 @@ HANDLE RegisterNotification(POPUPNOTIFICATION *notification) FontID fontid = { 0 };
fontid.cbSize = sizeof(fontid);
- mir_snprintf(fontid.group, SIZEOF(fontid.group), PU_FNT_AND_COLOR"/%s", notification->lpzGroup);
+ mir_snprintf(fontid.group, _countof(fontid.group), PU_FNT_AND_COLOR"/%s", notification->lpzGroup);
mir_strcpy(fontid.dbSettingsGroup, "PopupNotifications");
fontid.flags = FIDF_DEFAULTVALID;
fontid.deffontsettings.charset = DEFAULT_CHARSET;
fontid.deffontsettings.colour = ptd->notification.colorText;
fontid.deffontsettings.size = -11;
- mir_strncpy(fontid.deffontsettings.szFace, "MS Shell Dlg", SIZEOF(fontid.deffontsettings.szFace));
+ mir_strncpy(fontid.deffontsettings.szFace, "MS Shell Dlg", _countof(fontid.deffontsettings.szFace));
fontid.deffontsettings.style = 0;
- mir_snprintf(fontid.name, SIZEOF(fontid.name), "%s (colors only)", notification->lpzName);
- mir_snprintf(fontid.prefix, SIZEOF(fontid.prefix), "{%s/%s}text", notification->lpzGroup, notification->lpzName);
+ mir_snprintf(fontid.name, _countof(fontid.name), "%s (colors only)", notification->lpzName);
+ mir_snprintf(fontid.prefix, _countof(fontid.prefix), "{%s/%s}text", notification->lpzGroup, notification->lpzName);
fontid.deffontsettings.style = 0;
FontRegister(&fontid);
ColourID colourid = { 0 };
colourid.cbSize = sizeof(colourid);
- mir_snprintf(colourid.group, SIZEOF(colourid.group), PU_FNT_AND_COLOR"/%s", notification->lpzGroup);
+ mir_snprintf(colourid.group, _countof(colourid.group), PU_FNT_AND_COLOR"/%s", notification->lpzGroup);
mir_strcpy(colourid.dbSettingsGroup, "PopupNotifications");
- mir_snprintf(colourid.name, SIZEOF(colourid.name), "%s (colors only)", notification->lpzName);
- mir_snprintf(colourid.setting, SIZEOF(colourid.setting), "{%s/%s}backColor", notification->lpzGroup, notification->lpzName);
+ mir_snprintf(colourid.name, _countof(colourid.name), "%s (colors only)", notification->lpzName);
+ mir_snprintf(colourid.setting, _countof(colourid.setting), "{%s/%s}backColor", notification->lpzGroup, notification->lpzName);
colourid.defcolour = ptd->notification.colorBack;
ColourRegister(&colourid);
char section[MAXMODULELABELLENGTH], setting[MAXMODULELABELLENGTH];
- mir_snprintf(section, SIZEOF(section), "Popups/%s", notification->lpzGroup);
+ mir_snprintf(section, _countof(section), "Popups/%s", notification->lpzGroup);
mir_snprintf(setting, MODULNAME"_%s_%s", notification->lpzGroup, notification->lpzName);
SKINICONDESC sid = { 0 };
@@ -248,14 +248,14 @@ void FillNotificationData(POPUPDATA2 *ppd, DWORD *disableWhen) LOGFONTA lf; // dummy to make FS happy (use LOGFONTA coz we use MS_FONT_GET)
FontID fontid = { 0 }; // use ansi version of fontID coz POPUPNOTIFICATION use char
fontid.cbSize = sizeof(fontid);
- mir_snprintf(fontid.group, SIZEOF(fontid.group), PU_FNT_AND_COLOR"/%s", ptd->notification.lpzGroup);
- mir_snprintf(fontid.name, SIZEOF(fontid.name), "%s (colors only)", ptd->notification.lpzName);
+ mir_snprintf(fontid.group, _countof(fontid.group), PU_FNT_AND_COLOR"/%s", ptd->notification.lpzGroup);
+ mir_snprintf(fontid.name, _countof(fontid.name), "%s (colors only)", ptd->notification.lpzName);
ppd->colorText = (COLORREF)CallService(MS_FONT_GET, (WPARAM)&fontid, (LPARAM)&lf);
ColourID colourid = { 0 }; // use ansi version of ColourID coz POPUPNOTIFICATION use char
colourid.cbSize = sizeof(colourid);
- mir_snprintf(colourid.group, SIZEOF(colourid.group), PU_FNT_AND_COLOR"/%s", ptd->notification.lpzGroup);
- mir_snprintf(colourid.name, SIZEOF(colourid.name), "%s (colors only)", ptd->notification.lpzName);
+ mir_snprintf(colourid.group, _countof(colourid.group), PU_FNT_AND_COLOR"/%s", ptd->notification.lpzGroup);
+ mir_snprintf(colourid.name, _countof(colourid.name), "%s (colors only)", ptd->notification.lpzName);
ppd->colorBack = (COLORREF)CallService(MS_COLOUR_GET, (WPARAM)&colourid, 0);
char setting[MAXMODULELABELLENGTH];
|