summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-02-18 12:05:01 +0200
committerGeorge Hazan <ghazan@miranda.im>2018-02-18 12:05:01 +0200
commit66c4ae72a70a6e155c4a2a6d14c91c532cdb3974 (patch)
treea156c4d3b6c1d93ac0da2c07f1ecb32ec443e778
parentd694cea9f9f4a4b54a8a41c6be362fa5c14906d8 (diff)
fixes #1140 (WebView: bug with site adding)
-rw-r--r--plugins/WebView/src/webview_services.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/plugins/WebView/src/webview_services.cpp b/plugins/WebView/src/webview_services.cpp
index 91ae497ba7..83c6fde0ae 100644
--- a/plugins/WebView/src/webview_services.cpp
+++ b/plugins/WebView/src/webview_services.cpp
@@ -24,7 +24,6 @@
#include "webview.h"
static int searchId = -1;
-static wchar_t sID[32];
/*****************************************************************************/
static char szInvalidChars[] = { '\\', '/', ':', '*', '?', '\"', '<', '>', '|' };
@@ -304,7 +303,8 @@ INT_PTR BPLoadIcon(WPARAM wParam, LPARAM)
static void __cdecl BasicSearchTimerProc(void *pszNick)
{
PROTOSEARCHRESULT psr = { sizeof(psr) };
- psr.nick.w = (wchar_t*) pszNick;
+ psr.flags = PSR_UNICODE;
+ psr.nick.w = (wchar_t*)pszNick;
// broadcast the search result
ProtoBroadcastAck(MODULENAME, NULL, ACKTYPE_SEARCH, ACKRESULT_DATA, (HANDLE)1, (LPARAM)&psr);
@@ -312,23 +312,18 @@ static void __cdecl BasicSearchTimerProc(void *pszNick)
// exit the search
searchId = -1;
+ mir_free(psr.nick.w);
}
INT_PTR BasicSearch(WPARAM, LPARAM lParam)
{
- static wchar_t buf[300];
-
- if (lParam)
- mir_wstrncpy(buf, (const wchar_t*) lParam, 256);
-
if (searchId != -1)
return 0; // only one search at a time
- mir_wstrncpy(sID, (wchar_t*)lParam, _countof(sID));
searchId = 1;
// create a thread for the ID search
- mir_forkthread(BasicSearchTimerProc, &buf);
+ mir_forkthread(BasicSearchTimerProc, mir_wstrdup((const wchar_t*)lParam));
return searchId;
}