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/Msg_Export/src/utils.cpp | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) (limited to 'plugins/Msg_Export') diff --git a/plugins/Msg_Export/src/utils.cpp b/plugins/Msg_Export/src/utils.cpp index 1ab91a64c9..2dbfbdec7b 100755 --- a/plugins/Msg_Export/src/utils.cpp +++ b/plugins/Msg_Export/src/utils.cpp @@ -224,17 +224,12 @@ tstring _DBGetStringW(MCONTACT hContact, const char *szModule, const char *szSet { tstring ret; DBVARIANT dbv = { 0 }; - //db_get if (!db_get_ws(hContact, szModule, szSetting, &dbv)) { - if (dbv.type != DBVT_WCHAR) { - MessageBox(nullptr, TranslateT("Database: Attempt to get wrong type of value, string"), MSG_BOX_TITEL, MB_OK); - ret = pszError; - } - else ret = (wchar_t*)dbv.pszVal; + ret = (wchar_t*)dbv.pszVal; + db_free(&dbv); } else ret = pszError; - db_free(&dbv); return ret; } @@ -242,16 +237,12 @@ string _DBGetStringA(MCONTACT hContact, const char *szModule, const char *szSett { string ret; DBVARIANT dbv = { 0 }; - if (!db_get(hContact, szModule, szSetting, &dbv)) { - if (dbv.type != DBVT_ASCIIZ) { - MessageBox(nullptr, TranslateT("Database: Attempt to get wrong type of value, string"), MSG_BOX_TITEL, MB_OK); - ret = pszError; - } - else ret = dbv.pszVal; + if (!db_get_s(hContact, szModule, szSetting, &dbv)) { + ret = dbv.pszVal; + db_free(&dbv); } else ret = pszError; - db_free(&dbv); return ret; } -- cgit v1.2.3