summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/m_utils.h4
-rw-r--r--src/mir_core/src/openurl.cpp6
-rw-r--r--src/mir_core/src/subclass.cpp12
3 files changed, 15 insertions, 7 deletions
diff --git a/include/m_utils.h b/include/m_utils.h
index 70be2f654a..e287a89975 100644
--- a/include/m_utils.h
+++ b/include/m_utils.h
@@ -407,9 +407,9 @@ struct ENTER_STRING
#define MS_UTILS_ENTERSTRING "Utils/EnterString"
-__forceinline BOOL EnterString(ENTER_STRING *pForm)
+__forceinline INT_PTR EnterString(ENTER_STRING *pForm)
{
- return (BOOL)CallService(MS_UTILS_ENTERSTRING, 0, (LPARAM)pForm);
+ return CallService(MS_UTILS_ENTERSTRING, 0, (LPARAM)pForm);
}
#endif // M_UTILS_H__
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;