diff options
Diffstat (limited to 'plugins/HTTPServer/src')
| -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;
  }
  | 
