summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/Dbx_sqlite/src/dbevents.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/plugins/Dbx_sqlite/src/dbevents.cpp b/plugins/Dbx_sqlite/src/dbevents.cpp
index 5a287b03ad..48e3b6eb99 100644
--- a/plugins/Dbx_sqlite/src/dbevents.cpp
+++ b/plugins/Dbx_sqlite/src/dbevents.cpp
@@ -300,9 +300,12 @@ int CDbxSQLite::SetEventJson(MEVENT hDbEvent, const char *szSetting, DBVARIANT *
if (hDbEvent == 0)
return 1;
- { mir_cslock lock(m_csDbAccess);
- sqlite3_stmt *stmt = InitQuery("UPDATE events SET data=json_set(data, '$.?', ?) WHERE id = ?;", qEvEdit);
- sqlite3_bind_text(stmt, 1, szSetting, (int)mir_strlen(szSetting), nullptr);
+ CMStringA tmp(FORMAT, "$.%s", szSetting);
+ {
+ mir_cslock lock(m_csDbAccess);
+ sqlite3_stmt *stmt = InitQuery("UPDATE events SET data=json_set(data, ?, ?) WHERE id = ?;", qEvEdit);
+
+ sqlite3_bind_text(stmt, 1, tmp, tmp.GetLength(), nullptr);
switch (dbv->type) {
case DBVT_BYTE:
sqlite3_bind_int(stmt, 2, dbv->bVal);