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/Ping/src/log.cpp | 2 +- plugins/Ping/src/pinglist.cpp | 8 ++++---- plugins/Ping/src/utils.cpp | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'plugins/Ping/src') diff --git a/plugins/Ping/src/log.cpp b/plugins/Ping/src/log.cpp index 6c183f40bf..2ac0f8db41 100644 --- a/plugins/Ping/src/log.cpp +++ b/plugins/Ping/src/log.cpp @@ -37,7 +37,7 @@ INT_PTR GetLogFilename(WPARAM wParam, LPARAM lParam) { mir_wstrncat(filename, L"\\ping_log.txt", wParam - mir_wstrlen(filename)); } else { - mir_wstrncpy(filename, dbv.ptszVal, wParam); + mir_wstrncpy(filename, dbv.pwszVal, wParam); db_free(&dbv); } diff --git a/plugins/Ping/src/pinglist.cpp b/plugins/Ping/src/pinglist.cpp index d0edc89823..33c7f34388 100644 --- a/plugins/Ping/src/pinglist.cpp +++ b/plugins/Ping/src/pinglist.cpp @@ -116,13 +116,13 @@ bool read_ping_address(PINGADDRESS &pa) { DBVARIANT dbv; if (!db_get_ws(0, buff, "Address", &dbv)) { - mir_wstrncpy(pa.pszName, dbv.ptszVal, _countof(pa.pszName)); + mir_wstrncpy(pa.pszName, dbv.pwszVal, _countof(pa.pszName)); db_free(&dbv); } else return false; if (!db_get_ws(0, buff, "Label", &dbv)) { - mir_wstrncpy(pa.pszLabel, dbv.ptszVal, _countof(pa.pszLabel)); + mir_wstrncpy(pa.pszLabel, dbv.pwszVal, _countof(pa.pszLabel)); db_free(&dbv); } else return false; @@ -139,13 +139,13 @@ bool read_ping_address(PINGADDRESS &pa) { else pa.pszProto[0] = '\0'; if (!db_get_ws(0, buff, "Command", &dbv)) { - mir_wstrncpy(pa.pszCommand, dbv.ptszVal, _countof(pa.pszCommand)); + mir_wstrncpy(pa.pszCommand, dbv.pwszVal, _countof(pa.pszCommand)); db_free(&dbv); } else pa.pszCommand[0] = '\0'; if (!db_get_ws(0, buff, "CommandParams", &dbv)) { - mir_wstrncpy(pa.pszParams, dbv.ptszVal, _countof(pa.pszParams)); + mir_wstrncpy(pa.pszParams, dbv.pwszVal, _countof(pa.pszParams)); db_free(&dbv); } else diff --git a/plugins/Ping/src/utils.cpp b/plugins/Ping/src/utils.cpp index dda9d77211..2f603ec3a0 100644 --- a/plugins/Ping/src/utils.cpp +++ b/plugins/Ping/src/utils.cpp @@ -222,7 +222,7 @@ void import_ping_address(int index, PINGADDRESS &pa) { char buf[256]; mir_snprintf(buf, "Address%d", index); if (!db_get_ws(0, "PingPlug", buf, &dbv)) { - mir_wstrncpy(pa.pszName, dbv.ptszVal, _countof(pa.pszName)); + mir_wstrncpy(pa.pszName, dbv.pwszVal, _countof(pa.pszName)); db_free(&dbv); } else @@ -230,7 +230,7 @@ void import_ping_address(int index, PINGADDRESS &pa) { mir_snprintf(buf, "Label%d", index); if (!db_get_ws(0, "PingPlug", buf, &dbv)) { - mir_wstrncpy(pa.pszLabel, dbv.ptszVal, _countof(pa.pszLabel)); + mir_wstrncpy(pa.pszLabel, dbv.pwszVal, _countof(pa.pszLabel)); db_free(&dbv); } else -- cgit v1.2.3