diff options
author | George Hazan <george.hazan@gmail.com> | 2014-06-15 10:09:43 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-06-15 10:09:43 +0000 |
commit | c98b927af7a1ae35fb55e44c58fd409bfd73e018 (patch) | |
tree | d945647023a035812b4f1b3a217bbb1cbd3dc704 | |
parent | a7ba006098072342f492002071de04189626f024 (diff) |
fix for wrong DBVARIANT processing
git-svn-id: http://svn.miranda-ng.org/main/trunk@9495 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | plugins/HTTPServer/src/GuiElements.cpp | 18 |
1 files changed, 6 insertions, 12 deletions
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;
}
|