Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/plugin/NotificationMessage.cpp

Issue 6237450183639040: Issue 1283 - wrong usage of memset, fix sizeof, make proper initializing (Closed)
Patch Set: Created Sept. 1, 2014, 11:52 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/plugin/NotificationMessage.cpp
===================================================================
--- a/src/plugin/NotificationMessage.cpp
+++ b/src/plugin/NotificationMessage.cpp
@@ -16,7 +16,7 @@
if (!commonControlsInitialized)
{
INITCOMMONCONTROLSEX commControls;
- commControls.dwSize = sizeof(INITCOMMONCONTROLSEX);
+ commControls.dwSize = sizeof(commControls);
commControls.dwICC = ICC_BAR_CLASSES;
InitCommonControlsEx(&commControls);
commonControlsInitialized = true;
@@ -39,7 +39,7 @@
SetWindowPos(toolTipWindow, HWND_TOPMOST,0, 0, 0, 0,
SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
TOOLINFOW ti = {};
- ti.cbSize = sizeof(TOOLINFOW);
+ ti.cbSize = sizeof(ti);
ti.uFlags = TTF_IDISHWND | TTF_TRACK | TTF_TRANSPARENT;
ti.hwnd = parentWindow;
ti.hinst = NULL;
@@ -77,7 +77,7 @@
bool NotificationMessage::SetTextAndIcon(std::wstring text, std::wstring title, int icon)
{
TOOLINFOW ti = {};
- ti.cbSize = sizeof(TOOLINFOW);
+ ti.cbSize = sizeof(ti);
ti.hwnd = parentWindow;
ti.hinst = NULL;
ti.uId = (UINT_PTR)parentWindow;

Powered by Google App Engine
This is Rietveld