From c98b927af7a1ae35fb55e44c58fd409bfd73e018 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 15 Jun 2014 10:09:43 +0000 Subject: fix for wrong DBVARIANT processing git-svn-id: http://svn.miranda-ng.org/main/trunk@9495 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/HTTPServer/src/GuiElements.cpp | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'plugins') diff --git a/plugins/HTTPServer/src/GuiElements.cpp b/plugins/HTTPServer/src/GuiElements.cpp index b4d160294a..a3b60ea144 100644 --- a/plugins/HTTPServer/src/GuiElements.cpp +++ b/plugins/HTTPServer/src/GuiElements.cpp @@ -94,18 +94,12 @@ void ReplaceAll(tstring &sSrc, const TCHAR * pszReplace, const TCHAR * pszNew) { tstring DBGetString(MCONTACT hContact, const char *szModule, const char *szSetting, const TCHAR * pszError) { tstring ret; - DBVARIANT dbv = {0}; - if (!db_get(hContact, szModule, szSetting, &dbv)) { - if (dbv.type != DBVT_TCHAR) { - MessageBox(NULL, _T("DB: Attempt to get wrong type of value, string"), MSG_BOX_TITEL, MB_OK); - ret = pszError; - } else { - ret = dbv.ptszVal; - } - } else - ret = pszError; - db_free(&dbv); - return ret; + ptrT tszStr(db_get_tsa(hContact, szModule, szSetting)); + if (tszStr != NULL) + return LPTSTR(tszStr); + + MessageBox(NULL, _T("DB: Attempt to get wrong type of value, string"), MSG_BOX_TITEL, MB_OK); + return pszError; } -- cgit v1.2.3