From d296f9f99daf102b9af5d56690e2bd00d61c1267 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 24 Jul 2018 11:11:26 +0300 Subject: database: - senseless fiels ptszVal removed from DBVARIANT, pwszVal is used instead; - if you want db_get to return a string, you need to use db_get_s. --- plugins/AutoShutdown/src/settingsdlg.cpp | 4 ++-- plugins/AutoShutdown/src/watcher.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'plugins/AutoShutdown') diff --git a/plugins/AutoShutdown/src/settingsdlg.cpp b/plugins/AutoShutdown/src/settingsdlg.cpp index 3e59a08882..3109286671 100644 --- a/plugins/AutoShutdown/src/settingsdlg.cpp +++ b/plugins/AutoShutdown/src/settingsdlg.cpp @@ -123,8 +123,8 @@ static INT_PTR CALLBACK SettingsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L { DBVARIANT dbv; if (!db_get_ws(NULL, MODULENAME, "Message", &dbv)) { - SetDlgItemText(hwndDlg, IDC_EDIT_MESSAGE, dbv.ptszVal); - mir_free(dbv.ptszVal); + SetDlgItemText(hwndDlg, IDC_EDIT_MESSAGE, dbv.pwszVal); + mir_free(dbv.pwszVal); } } /* cpuusage threshold */ diff --git a/plugins/AutoShutdown/src/watcher.cpp b/plugins/AutoShutdown/src/watcher.cpp index fbd2987e8b..529954f758 100644 --- a/plugins/AutoShutdown/src/watcher.cpp +++ b/plugins/AutoShutdown/src/watcher.cpp @@ -100,11 +100,11 @@ static int MsgEventAdded(WPARAM, LPARAM hDbEvent) if (dbe.eventType == EVENTTYPE_MESSAGE && !(dbe.flags & DBEF_SENT)) { DBVARIANT dbv; if (!db_get_ws(NULL, MODULENAME, "Message", &dbv)) { - TrimString(dbv.ptszVal); + TrimString(dbv.pwszVal); wchar_t *pszMsg = GetMessageText(&dbe.pBlob, &dbe.cbBlob); - if (pszMsg != nullptr && wcsstr(pszMsg, dbv.ptszVal) != nullptr) + if (pszMsg != nullptr && wcsstr(pszMsg, dbv.pwszVal) != nullptr) ShutdownAndStopWatcher(); /* msg with specified text recvd */ - mir_free(dbv.ptszVal); /* does NULL check */ + mir_free(dbv.pwszVal); /* does NULL check */ } } mir_free(dbe.pBlob); -- cgit v1.2.3