diff --git a/Library/MeasureWifiStatus.cpp b/Library/MeasureWifiStatus.cpp index 3b43a7c53..60465193d 100644 --- a/Library/MeasureWifiStatus.cpp +++ b/Library/MeasureWifiStatus.cpp @@ -41,7 +41,7 @@ MeasureWifiStatus::MeasureWifiStatus(Skin* skin, const WCHAR* name) : Measure(sk if (!s_Client) { DWORD dwNegotiatedVersion = 0UL; - DWORD dwErr =WlanOpenHandle(WLAN_API_VERSION, nullptr, &dwNegotiatedVersion, &s_Client); + DWORD dwErr = WlanOpenHandle(WLAN_API_VERSION, nullptr, &dwNegotiatedVersion, &s_Client); if (ERROR_SUCCESS != dwErr) { FinalizeHandle(); diff --git a/Library/MeterLine.cpp b/Library/MeterLine.cpp index 624d753b9..c3df26d04 100644 --- a/Library/MeterLine.cpp +++ b/Library/MeterLine.cpp @@ -269,12 +269,6 @@ bool MeterLine::Draw(Gfx::Canvas& canvas) } } - if (maxValue == minValue) - { - //minValue = 0.0; - //maxValue = 1.0; - } - D2D1_RECT_F meterRect = GetMeterRectPadding(); int drawW = (int)(meterRect.right - meterRect.left); int drawH = (int)(meterRect.bottom - meterRect.top); diff --git a/Library/Util.cpp b/Library/Util.cpp index 298a17282..9c04c026a 100644 --- a/Library/Util.cpp +++ b/Library/Util.cpp @@ -19,9 +19,9 @@ UINT GetUniqueID() WCHAR* GetString(UINT id) { - LPWSTR pData; + LPWSTR pData = nullptr; int len = LoadString(GetRainmeter().GetResourceInstance(), id, (LPWSTR)&pData, 0); - return len ? pData : L""; + return len > 0 ? pData : L""; } std::wstring GetFormattedString(UINT id, ...) @@ -55,7 +55,7 @@ HICON GetIcon(UINT id, bool large) auto loadIconMetric = (decltype(LoadIconMetric)*)GetProcAddress(hComctl, "LoadIconMetric"); if (loadIconMetric) { - HICON icon; + HICON icon = { 0 }; HRESULT hr = loadIconMetric(hExe, MAKEINTRESOURCE(id), large ? LIM_LARGE : LIM_SMALL, &icon); if (SUCCEEDED(hr)) {