diff options
author | George Hazan <ghazan@miranda.im> | 2019-07-24 12:45:36 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-07-24 12:45:36 +0300 |
commit | 30dad0388a14244ef9b06afc113085f6a49bcbb8 (patch) | |
tree | ea929713b37ab4a0e91d275f6c376b53a03e0c94 /src | |
parent | 3abaf1281dee362d493147e40fa3c5a2b924effe (diff) |
warning fixes
Diffstat (limited to 'src')
-rw-r--r-- | src/mir_core/src/openurl.cpp | 6 | ||||
-rw-r--r-- | src/mir_core/src/subclass.cpp | 12 |
2 files changed, 13 insertions, 5 deletions
diff --git a/src/mir_core/src/openurl.cpp b/src/mir_core/src/openurl.cpp index 162ee052af..c24e000738 100644 --- a/src/mir_core/src/openurl.cpp +++ b/src/mir_core/src/openurl.cpp @@ -41,16 +41,16 @@ static void __cdecl OpenURLThread(TOpenUrlInfo *hUrlInfo) // wack a protocol on it
CMStringW tszUrl;
if ((isalpha(hUrlInfo->szUrl[0]) && hUrlInfo->szUrl[1] == ':') || hUrlInfo->szUrl[0] == '\\')
- tszUrl.Format(L"file:///%s", hUrlInfo->szUrl);
+ tszUrl.Format(L"file:///%s", hUrlInfo->szUrl.get());
else {
int i;
for (i = 0; iswalpha(hUrlInfo->szUrl[i]); i++);
if (hUrlInfo->szUrl[i] == ':')
tszUrl = hUrlInfo->szUrl;
else if (!wcsnicmp(hUrlInfo->szUrl, L"ftp.", 4))
- tszUrl.Format(L"ftp://%s", hUrlInfo->szUrl);
+ tszUrl.Format(L"ftp://%s", hUrlInfo->szUrl.get());
else
- tszUrl.Format(L"http://%s", hUrlInfo->szUrl);
+ tszUrl.Format(L"http://%s", hUrlInfo->szUrl.get());
}
// check user defined browser for opening urls
diff --git a/src/mir_core/src/subclass.cpp b/src/mir_core/src/subclass.cpp index c020a2666c..032b29d1e7 100644 --- a/src/mir_core/src/subclass.cpp +++ b/src/mir_core/src/subclass.cpp @@ -80,7 +80,11 @@ MIR_CORE_DLL(void) mir_subclassWindow(HWND hWnd, WNDPROC wndProc) if (p->m_hooks[i] == wndProc)
return;
- p->m_hooks = (WNDPROC*)realloc(p->m_hooks, (p->m_iHooks+1)*sizeof(WNDPROC));
+ void *tmp = realloc(p->m_hooks, (p->m_iHooks+1)*sizeof(WNDPROC));
+ if (tmp == nullptr)
+ return;
+
+ p->m_hooks = (WNDPROC *)tmp;
}
p->m_hooks[p->m_iHooks++] = wndProc;
@@ -104,7 +108,11 @@ MIR_CORE_DLL(void) mir_subclassWindowFull(HWND hWnd, WNDPROC wndProc, WNDPROC ol if (p->m_hooks[i] == wndProc)
return;
- p->m_hooks = (WNDPROC*)realloc(p->m_hooks, (p->m_iHooks+1)*sizeof(WNDPROC));
+ void *tmp = realloc(p->m_hooks, (p->m_iHooks+1)*sizeof(WNDPROC));
+ if (tmp == nullptr)
+ return;
+
+ p->m_hooks = (WNDPROC *)tmp;
}
p->m_hooks[p->m_iHooks++] = wndProc;
|