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/Spamotron/src/options.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins/Spamotron/src') diff --git a/plugins/Spamotron/src/options.cpp b/plugins/Spamotron/src/options.cpp index bb2a2d15db..8f2761300f 100644 --- a/plugins/Spamotron/src/options.cpp +++ b/plugins/Spamotron/src/options.cpp @@ -9,7 +9,7 @@ wchar_t* _getCOptS(wchar_t *buf, unsigned int buflen, MCONTACT hContact, const c if (db_get_ws(hContact, MODULENAME, option, &dbv) != 0) wcsncpy(buf, def, min(buflen, mir_wstrlen(def)+1)); else if (dbv.type == DBVT_WCHAR) { - wcsncpy(buf, dbv.ptszVal, min(buflen, mir_wstrlen(dbv.ptszVal)+1)); + wcsncpy(buf, dbv.pwszVal, min(buflen, mir_wstrlen(dbv.pwszVal)+1)); } db_free(&dbv); return buf; @@ -22,7 +22,7 @@ wchar_t* _getMOptS(wchar_t *buf, unsigned int buflen, const char* module, const if (db_get_s(NULL, module, option, &dbv) != 0) wcsncpy(buf, def, min(buflen, mir_wstrlen(def)+1)); else if (dbv.type == DBVT_WCHAR) { - wcsncpy(buf, dbv.ptszVal, min(buflen, mir_wstrlen(dbv.ptszVal)+1)); + wcsncpy(buf, dbv.pwszVal, min(buflen, mir_wstrlen(dbv.pwszVal)+1)); } else { tmp = mir_a2u(dbv.pszVal); wcsncpy(buf, tmp, min(buflen, mir_wstrlen(tmp)+1)); -- cgit v1.2.3